Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / test_boxing.nit
index 2263140..247c591 100644 (file)
 # By Flop
 
 class Gene[T]
-       readable var _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]
+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)