Changeset 1740
- Timestamp:
- 11/07/08 16:16:30 (2 months ago)
- Location:
- cobra/trunk
- Files:
-
- 1 added
- 1 modified
-
Source/Expr.cobra (modified) (2 diffs)
-
Tests/120-classes/322-construct-prop-set-error.cobra (added)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/Expr.cobra
r1736 r1740 679 679 else 680 680 .throwError('Argument [i+1] of method "[_name]" expects type [param.type.name], but the call is supplying type [arg.type.name].') 681 # end of _bindImp helpers682 681 683 682 def toCobraSource as String is override … … 1510 1509 if not arg.left inherits IdentifierExpr 1511 1510 .recordError('General purpose assignments are not allowed as arguments. Assignment syntax can only be used for keyword arguments.') 1512 # TODO: check property name 1511 if not expr.receiverType.isDynamicOrPassThrough 1512 propertyName = (arg.left to IdentifierExpr).name 1513 if expr.memberForName(propertyName) is nil 1514 suggs = .expr.suggestionsForBadMemberName(propertyName) 1515 isBoxAccess = expr inherits IdentifierExpr and (expr to IdentifierExpr).definition inherits Box # like "Console.writeLine" where the receiver is a literal class or struct reference 1516 whoseTypeIs = if(isBoxAccess, '', ' whose type is "[expr.receiverType.name]"') 1517 .recordError('Cannot find a definition for "[propertyName]" in "[expr.toCobraSource]"[whoseTypeIs].[_suggestionsMessage(suggs)]') 1513 1518 arg.right.bindImp # 'x=y' has special treatment in arguments 1514 1519 else
