tests: update related to the init changes
authorJean Privat <privat@pryen.org>
Sat, 27 Sep 2014 08:23:21 +0000 (04:23 -0400)
committerJean Privat <privat@pryen.org>
Sat, 27 Sep 2014 09:38:30 +0000 (05:38 -0400)
Signed-off-by: Jean Privat <privat@pryen.org>

tests/example_objet.nit
tests/example_point.nit
tests/sav/base_init_combine_alt1.res
tests/sav/error_init_auto_alt4.res
tests/test_create.nit
tests/test_create_more.nit

index 891a3d9..7473896 100644 (file)
@@ -62,8 +62,8 @@ private
 # receveur ("self")
 
 # Les attributs sont déclarés par le mot clé "fun" et commencent par un "@"
-       var nom_: String                # Un entrepôt a un nom (de type chaîne).
-       var rayons: Array[Rayon]        # Il est composé d'un ensemble de rayon.
+       var nom_: String is noinit              # Un entrepôt a un nom (de type chaîne).
+       var rayons: Array[Rayon] is noinit      # Il est composé d'un ensemble de rayon.
        # "Array" est une classe paramétrée, les crochets en sont la marque.
        # La classe "Rayon" est définie plus loin
 
index 2ad57c5..a7b89ea 100644 (file)
@@ -16,8 +16,8 @@
 
 class Point
 private
-       var x: Int      # Abscisse
-       var y: Int      # Ordonnée
+       var x: Int = 0  # Abscisse
+       var y: Int = 0  # Ordonnée
 
        # Change la position d'un point
        fun moveto(x: Int, y: Int)
@@ -38,11 +38,6 @@ private
        end
 
 
-       init
-       do
-               moveto(0, 0)
-       end
-
        init at(x: Int, y: Int)
        do
                moveto(x, y)
index 5759dba..510c2f5 100644 (file)
@@ -1 +1,9 @@
-alt/base_init_combine_alt1.nit:52,6: Error: base_init_combine_alt1#F cannot inherit constructors from E because there is attributes without initial values: z: Int
+1
+2
+2
+3
+2
+2
+5
+2
+6
index 0bb1a5e..65c6fb1 100644 (file)
@@ -1,3 +1,3 @@
-alt/error_init_auto_alt4.nit:35,5--12: Error: Incorrect number of parameters. Got 1, expected 0. Signature is 
-alt/error_init_auto_alt4.nit:36,5--15: Error: Incorrect number of parameters. Got 2, expected 0. Signature is 
-alt/error_init_auto_alt4.nit:37,5--18: Error: Incorrect number of parameters. Got 3, expected 0. Signature is 
+alt/error_init_auto_alt4.nit:34,5--9: Error: Incorrect number of parameters. Got 0, expected 1. Signature is (x: Int)
+alt/error_init_auto_alt4.nit:36,5--15: Error: Incorrect number of parameters. Got 2, expected 1. Signature is (x: Int)
+alt/error_init_auto_alt4.nit:37,5--18: Error: Incorrect number of parameters. Got 3, expected 1. Signature is (x: Int)
index c41c81a..0eee185 100644 (file)
@@ -24,7 +24,7 @@ redef class Object
 end
 
 class Toto
-       var a: Int
+       var a: Int is noinit
        redef fun output
        do
                printn(_a)
index 844ffee..d870cea 100644 (file)
@@ -15,8 +15,8 @@
 # limitations under the License.
 
 class A
-       var attribute: nullable A
-       var num: Char
+       var attribute: nullable A is noinit
+       var num: Char is noinit
 
        fun foo=(a: nullable A)
        do