Ticket #142: ticket142.patch
File ticket142.patch, 1.1 KB (added by eric.sellon, 15 years ago) |
---|
-
Source/Members.cobra
979 979 for decl in .parentBox.declsInOrder 980 980 if decl inherits BoxVar 981 981 assert decl.type 982 if not decl.type inherits NilableType and decl.type.isReference and not decl.isShared 982 if not decl.type inherits NilableType and decl.type.isReference and not decl.isShared and not .parentBox.isGeneric 983 983 if decl.name.startsWith('_') 984 984 expr = IdentifierExpr(token, decl) to Expr 985 985 else -
Tests/240-generics/300-declare-generic-classes/604-instantiate-with-nilable-type.cobra
1 class G<of T> 2 var myT as T 3 4 class Program 5 var g = G<of int?>() 6 7 def foo 8 pass 9 10 def main 11 p = Program() 12 p.foo