Ticket #100: final-errck.patch
File final-errck.patch, 1.5 KB (added by hopscc, 16 years ago) |
---|
-
Source/Members.cobra
111 111 base.isUsed = value 112 112 .resultType.isUsed = true 113 113 114 get isFinal as bool 115 return 'final' in _isNames 116 114 117 get englishName as String is abstract 115 118 116 119 get defaultAccessLevel as String … … 476 479 inherits BoxField 477 480 implements IVar 478 481 """ 479 A BoxVar is a variable or constantdeclared for a box, whether instance or shared. For example:482 A BoxVar is a variable declared for a box, whether instance or shared. For example: 480 483 var _x as int is shared 481 constPI = 3.14484 var myPI = 3.14 482 485 483 486 Classes and structs can have vars, but interfaces cannot. 484 487 """ -
Source/BinaryOpExpr.cobra
191 191 if _left inherits NameExpr 192 192 _trackLocal = _left.definition inherits AbstractLocalVar 193 193 if _trackLocal, _trackName = _left.namedDefinition.name 194 if .curCodeMember and not .curCodeMember inherits Initializer and _left.definition inherits BoxVar and _left.definition.isFinal 195 .throwError('The final field "[_left.definition.name]" cannot be assigned to except in an initializer or the fields declaration and initialization') 196 194 197 195 198 196 199 class AssignExpr