Changeset 1713
- Timestamp:
- 10/29/08 01:21:51 (2 months ago)
- Location:
- cobra/trunk
- Files:
-
- 1 added
- 2 modified
-
Source/Members.cobra (modified) (3 diffs)
-
Source/Vars.cobra (modified) (1 diff)
-
Tests/120-classes/220-fields-error-incompatible-expr.cobra (added)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/Members.cobra
r1712 r1713 397 397 def addRefFields is override 398 398 base.addRefFields 399 if _type 400 .addField('type', _type) 401 else 402 .addField('typeNode', _typeNode) 399 if _type, .addField('type', _type) 400 else, .addField('typeNode', _typeNode) 403 401 404 402 def addSubFields is override … … 434 432 node.doNotPopIfInheritsStack 435 433 count -= 1 436 if count == 0 437 break 434 if count == 0, break 438 435 return true 439 436 else … … 449 446 if _type is nil 450 447 _type = _initExpr.type 451 else if not _initExpr. isKindOf(_type to !)452 .throwError(' The expression type of [_initExpr.type.name] does not match the variable type of [_type.name].')448 else if not _initExpr.canBeAssignedTo(_type to !) 449 .throwError('Incompatible types. Cannot assign value of type [_initExpr.type.name] on the right to [_type.name] on the left.') 453 450 454 451 get resultType as IType is override -
cobra/trunk/Source/Vars.cobra
r1645 r1713 114 114 node.doNotPopIfInheritsStack 115 115 count -= 1 116 if count == 0 117 break 116 if count == 0, break 118 117 return true 119 118 else
