Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / test_boxing.nit
index 6501016..247c591 100644 (file)
 # By Flop
 
 class Gene[T]
-       readable attr _a_ : T 
-       meth a: T
+       var a_ : T
+       fun a: T
        do
-               return _a_
+               return a_
        end
 
-       init do end
+       init(a:T) do a_ = a
 
 end
-class GeneBool special Gene[Bool]
-       meth a=(b: Bool)
+class GeneBool
+       super Gene[Bool]
+       fun a=(b: Bool)
        do
-               _a_ = b
+               a_ = b
        end
 
-       init do end
+       init(a) do super(a)
 end
 
-var x = new Gene[Bool]
-var g = new GeneBool
+var x = new Gene[Bool](false)
+var g = new GeneBool(false)
 g.a = true
 print(g.a)