Changeset 1603
- Timestamp:
- 08/28/08 07:30:27 (3 months ago)
- Location:
- cobra/trunk
- Files:
-
- 2 modified
-
Source/Expr.cobra (modified) (1 diff)
-
Tests/120-classes/320-construct-prop-set.cobra (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/Expr.cobra
r1599 r1603 1491 1491 arg = arg.right 1492 1492 else 1493 argsForInitCall.add( IdentifierExpr(token.copy('ID', 'arg[i]')))1493 argsForInitCall.add(if(arg inherits NilLiteral, arg, IdentifierExpr(token.copy('ID', 'arg[i]')))) 1494 1494 paramsForDecl.add(Param(box.token.copy('ID', 'arg[i]'), arg.type)) 1495 1495 i += 1 -
cobra/trunk/Tests/120-classes/320-construct-prop-set.cobra
r1601 r1603 19 19 assert s.b == 'b' 20 20 21 t = Thing(nil, data=5) # test passing nil to a strongly typed arg 22 assert t.data == 5 23 24 21 25 class Stuff 22 26 … … 33 37 34 38 pro b from var 39 40 41 class Thing 42 43 var _data as dynamic? 44 45 def init(s as Stuff?) 46 pass 47 48 pro data from var
