mm: changes to_s of signatures to include param names and corrects tests
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 17 Aug 2011 17:13:47 +0000 (13:13 -0400)
committerJean Privat <jean@pryen.org>
Thu, 6 Oct 2011 13:41:43 +0000 (09:41 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

19 files changed:
src/metamodel/static_type.nit
tests/sav/base_closure2_alt2.sav
tests/sav/base_closure3_alt1.sav
tests/sav/base_closure_raf_alt2.fail
tests/sav/base_init_linext2_alt2.sav
tests/sav/base_init_linext2_alt4.sav
tests/sav/base_vararg_alt1.sav
tests/sav/base_vararg_alt2.sav
tests/sav/base_vararg_alt3.sav
tests/sav/base_vararg_alt4.sav
tests/sav/base_vararg_alt5.sav
tests/sav/base_vararg_alt6.sav
tests/sav/base_vararg_alt7.sav
tests/sav/base_vararg_alt8.sav
tests/sav/error_expr_not_ok_alt4.sav
tests/sav/error_expr_not_ok_alt5.sav
tests/sav/error_init_auto.sav
tests/sav/error_init_auto_alt2.sav
tests/sav/error_init_auto_alt3.sav

index 7ebfaab..df18ab0 100644 (file)
@@ -76,6 +76,8 @@ class MMParam
            _mmtype = t
            _name = n
        end
+
+       redef fun to_s do return "{name}: {mmtype}"
 end
 
 # Signature for local properties
@@ -148,12 +150,10 @@ class MMSignature
                        var tmp: String
                        var a = new Array[String].with_capacity(_params.length)
                        for i in [0.._params.length[ do
-                               #var pn = _params_name[i]
                                var p = _params[i]
-                               #a.add("{pn}: {p}")
                                a.add(p.to_s)
                        end
-                       s.append("({a.join(",")})")
+                       s.append("({a.join(", ")})")
                end
                var rt = _return_type
                if rt != null then s.append(": {rt}")
index 6b6842d..8062d4a 100644 (file)
@@ -1 +1 @@
-alt/base_closure2_alt2.nit:25,3--5: Error: arity mismatch; prototype is 'bar(Int)'.
+alt/base_closure2_alt2.nit:25,3--5: Error: arity mismatch; prototype is 'bar(i: Int)'.
index 4be4f2a..fd9b06f 100644 (file)
@@ -1 +1 @@
-alt/base_closure3_alt1.nit:25,3--14: Error: arity mismatch; prototype is 'bar(Int,Int,A)'.
+alt/base_closure3_alt1.nit:25,3--14: Error: arity mismatch; prototype is 'bar(k: Int, l: Int, a: A)'.
index 2a2c314..88a4932 100644 (file)
@@ -1 +1 @@
-alt/base_closure_raf_alt2.nit:29,3--5: Error: arity mismatch; prototype is 'bar(Int)'.
+alt/base_closure_raf_alt2.nit:29,3--5: Error: arity mismatch; prototype is 'bar(i: Int)'.
index 66f86c6..8c60593 100644 (file)
@@ -1 +1 @@
-alt/base_init_linext2_alt2.nit:99,2--112,12: Error: there is no available compatible constructor in B. Discarded candidates are base_init_linext2_alt2::B::initb, base_init_linext2_alt2::B::init_par, base_init_linext2_alt2::B::init_par2(Char).
+alt/base_init_linext2_alt2.nit:99,2--112,12: Error: there is no available compatible constructor in B. Discarded candidates are base_init_linext2_alt2::B::initb, base_init_linext2_alt2::B::init_par, base_init_linext2_alt2::B::init_par2(c: Char).
index 71438c3..e4441aa 100644 (file)
@@ -1,2 +1,2 @@
 alt/base_init_linext2_alt4.nit:105,3--7: Error: Constructor of B must be invoked before constructor of C
-alt/base_init_linext2_alt4.nit:99,2--113,12: Error: there is no available compatible constructor in B. Discarded candidates are base_init_linext2_alt4::B::initb, base_init_linext2_alt4::B::init_par, base_init_linext2_alt4::B::init_par2(Char).
+alt/base_init_linext2_alt4.nit:99,2--113,12: Error: there is no available compatible constructor in B. Discarded candidates are base_init_linext2_alt4::B::initb, base_init_linext2_alt4::B::init_par, base_init_linext2_alt4::B::init_par2(c: Char).
index dfd0f04..57003b6 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt1.nit:51,1--3: Error: arity mismatch; prototype is 'foo(Char)'.
+alt/base_vararg_alt1.nit:51,1--3: Error: arity mismatch; prototype is 'foo(a: Char)'.
index f925a78..3e3cfea 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt2.nit:54,1--3: Error: arity mismatch; prototype is 'bar(Char,Char)'.
+alt/base_vararg_alt2.nit:54,1--3: Error: arity mismatch; prototype is 'bar(b: Char, a: Char)'.
index e904ab4..769fb6c 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt3.nit:55,1--7: Error: arity mismatch; prototype is 'bar(Char,Char)'.
+alt/base_vararg_alt3.nit:55,1--7: Error: arity mismatch; prototype is 'bar(b: Char, a: Char)'.
index e06aea1..dd43957 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt4.nit:58,1--3: Error: arity mismatch; prototype is 'baz(Char,Char)'.
+alt/base_vararg_alt4.nit:58,1--3: Error: arity mismatch; prototype is 'baz(a: Char, b: Char)'.
index b21e311..aea970c 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt5.nit:59,1--7: Error: arity mismatch; prototype is 'baz(Char,Char)'.
+alt/base_vararg_alt5.nit:59,1--7: Error: arity mismatch; prototype is 'baz(a: Char, b: Char)'.
index 78323c9..9fcbecc 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt6.nit:62,1--6: Error: arity mismatch; prototype is 'foobar(Char,Char,Char)'.
+alt/base_vararg_alt6.nit:62,1--6: Error: arity mismatch; prototype is 'foobar(b: Char, a: Char, c: Char)'.
index 85c090b..ea9f0ff 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt7.nit:63,1--10: Error: arity mismatch; prototype is 'foobar(Char,Char,Char)'.
+alt/base_vararg_alt7.nit:63,1--10: Error: arity mismatch; prototype is 'foobar(b: Char, a: Char, c: Char)'.
index b9856cc..75c3324 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt8.nit:64,1--14: Error: arity mismatch; prototype is 'foobar(Char,Char,Char)'.
+alt/base_vararg_alt8.nit:64,1--14: Error: arity mismatch; prototype is 'foobar(b: Char, a: Char, c: Char)'.
index fa0caf6..08cdff4 100644 (file)
@@ -10,7 +10,7 @@ alt/error_expr_not_ok_alt4.nit:43,1--8: Error: Method 'fail' doesn't exists in I
 alt/error_expr_not_ok_alt4.nit:45,7--10: Type error: expected A, got Object
 alt/error_expr_not_ok_alt4.nit:46,1--9: Error: Method 'fail' doesn't exists in Object.
 alt/error_expr_not_ok_alt4.nit:49,7--10: Type error: expected A, got Object
-alt/error_expr_not_ok_alt4.nit:50,1--10: Error: arity mismatch; prototype is 'trash(A)'.
+alt/error_expr_not_ok_alt4.nit:50,1--10: Error: arity mismatch; prototype is 'trash(x: A)'.
 alt/error_expr_not_ok_alt4.nit:60,4--7: Type error: expected Bool, got Int
 alt/error_expr_not_ok_alt4.nit:60,20: Type error: expected A, got Int
 alt/error_expr_not_ok_alt4.nit:62,10--13: Type error: expected Bool, got Int
index 6ba1a15..c792c2c 100644 (file)
@@ -11,7 +11,7 @@ alt/error_expr_not_ok_alt5.nit:43,1--8: Error: Method 'fail' doesn't exists in I
 alt/error_expr_not_ok_alt5.nit:45,7--10: Type error: expected A, got Object
 alt/error_expr_not_ok_alt5.nit:46,1--9: Error: Method 'fail' doesn't exists in Object.
 alt/error_expr_not_ok_alt5.nit:49,7--10: Type error: expected A, got Object
-alt/error_expr_not_ok_alt5.nit:50,1--10: Error: arity mismatch; prototype is 'trash(A)'.
+alt/error_expr_not_ok_alt5.nit:50,1--10: Error: arity mismatch; prototype is 'trash(x: A)'.
 alt/error_expr_not_ok_alt5.nit:60,4--7: Type error: expected Bool, got Int
 alt/error_expr_not_ok_alt5.nit:60,20: Type error: expected A, got Int
 alt/error_expr_not_ok_alt5.nit:62,10--13: Type error: expected Bool, got Int
index 7efd1c0..5f13350 100644 (file)
@@ -1,4 +1,4 @@
-./error_init_auto.nit:34,5--9: Error: arity mismatch; prototype is 'init(Int)'.
-./error_init_auto.nit:36,5--14: Error: arity mismatch; prototype is 'init(Int)'.
-./error_init_auto.nit:37,5--17: Error: arity mismatch; prototype is 'init(Int)'.
+./error_init_auto.nit:34,5--9: Error: arity mismatch; prototype is 'init(recv: Int)'.
+./error_init_auto.nit:36,5--14: Error: arity mismatch; prototype is 'init(recv: Int)'.
+./error_init_auto.nit:37,5--17: Error: arity mismatch; prototype is 'init(recv: Int)'.
 ./error_init_auto.nit:38,5--15: Error: Method 'foo' doesn't exists in A.
index 9a2fd2f..113433e 100644 (file)
@@ -1,4 +1,4 @@
-alt/error_init_auto_alt2.nit:33,5--9: Error: arity mismatch; prototype is 'init(Int,Int)'.
-alt/error_init_auto_alt2.nit:34,5--11: Error: arity mismatch; prototype is 'init(Int,Int)'.
-alt/error_init_auto_alt2.nit:36,5--17: Error: arity mismatch; prototype is 'init(Int,Int)'.
+alt/error_init_auto_alt2.nit:33,5--9: Error: arity mismatch; prototype is 'init(recv: Int, recv: Int)'.
+alt/error_init_auto_alt2.nit:34,5--11: Error: arity mismatch; prototype is 'init(recv: Int, recv: Int)'.
+alt/error_init_auto_alt2.nit:36,5--17: Error: arity mismatch; prototype is 'init(recv: Int, recv: Int)'.
 alt/error_init_auto_alt2.nit:37,5--15: Error: Method 'foo' doesn't exists in A.
index e6e49ac..c3598ce 100644 (file)
@@ -1,4 +1,4 @@
-alt/error_init_auto_alt3.nit:34,5--9: Error: arity mismatch; prototype is 'init(Int)'.
-alt/error_init_auto_alt3.nit:36,5--14: Error: arity mismatch; prototype is 'init(Int)'.
-alt/error_init_auto_alt3.nit:37,5--17: Error: arity mismatch; prototype is 'init(Int)'.
+alt/error_init_auto_alt3.nit:34,5--9: Error: arity mismatch; prototype is 'init(xx: Int)'.
+alt/error_init_auto_alt3.nit:36,5--14: Error: arity mismatch; prototype is 'init(xx: Int)'.
+alt/error_init_auto_alt3.nit:37,5--17: Error: arity mismatch; prototype is 'init(xx: Int)'.
 alt/error_init_auto_alt3.nit:38,5--15: Error: Method 'foo' doesn't exists in A.