Ticket #75: ticket75.patch
File ticket75.patch, 1.0 KB (added by eric.sellon, 15 years ago) |
---|
-
Source/BinaryOpExpr.cobra
224 224 if _type is nil 225 225 _type = .compiler.passThroughType 226 226 throw 227 if _left inherits DotExpr and _left.definition inherits Property and _left.definition.setPart is nil 228 .throwError('Cannot assign to property [_left.definition.name] since it is read only.') 227 229 left = _left 228 230 right = _right 229 231 assert right.type -
Tests/120-classes/500-properties/320-properties-read-only-assign.cobra
1 class X 2 3 var _bob as String? 4 5 get two as int 6 return 2 7 8 pro bob from var 9 10 def main is shared 11 x = X() 12 x.bob = "hi" 13 x.two = 4 # .error. Cannot assign