syntax: arity missmatch error messages show prototypes
authorJean Privat <jean@pryen.org>
Wed, 29 Jul 2009 18:16:19 +0000 (14:16 -0400)
committerJean Privat <jean@pryen.org>
Thu, 30 Jul 2009 13:17:36 +0000 (09:17 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

22 files changed:
src/syntax/typing.nit
tests/sav/base_closure1_alt2.sav
tests/sav/base_closure2_alt2.sav
tests/sav/base_closure3_alt1.sav
tests/sav/base_closure4_alt2.sav
tests/sav/base_closure_break_alt2.sav
tests/sav/base_closure_raf_alt13.fail
tests/sav/base_closure_raf_alt2.fail
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_alt1.sav
tests/sav/error_init_auto_alt2.sav
tests/sav/error_init_auto_alt3.sav

index 27e469c..9a807e6 100644 (file)
@@ -1076,7 +1076,7 @@ redef class AAbsAbsSendExpr
                var raw_arity: Int
                if raw_args == null then raw_arity = 0 else raw_arity = raw_args.length
                if par_arity > raw_arity or (par_arity != raw_arity and par_vararg == -1) then
-                       v.error(self, "Error: '{name}' arity missmatch.")
+                       v.error(self, "Error: arity missmatch; prototype is '{name}{psig}'.")
                        return false
                end
                var arg_idx = 0
index 0476d1c..b5a1d3f 100644 (file)
@@ -1 +1 @@
-alt/base_closure1_alt2.nit:25,3--7: Error: 'bar' arity missmatch.
+alt/base_closure1_alt2.nit:25,3--7: Error: arity missmatch; prototype is 'bar'.
index 90c7a59..cdd6e13 100644 (file)
@@ -1 +1 @@
-alt/base_closure2_alt2.nit:25,3--5: Error: 'bar' arity missmatch.
+alt/base_closure2_alt2.nit:25,3--5: Error: arity missmatch; prototype is 'bar(Int)'.
index 3634719..7dce49a 100644 (file)
@@ -1 +1 @@
-alt/base_closure3_alt1.nit:25,3--14: Error: 'bar' arity missmatch.
+alt/base_closure3_alt1.nit:25,3--14: Error: arity missmatch; prototype is 'bar(Int,Int,A)'.
index e8cf91f..94170d4 100644 (file)
@@ -1 +1 @@
-alt/base_closure4_alt2.nit:25,3--7: Error: 'bar' arity missmatch.
+alt/base_closure4_alt2.nit:25,3--7: Error: arity missmatch; prototype is 'bar: Int'.
index fc39a6c..ac4e1c7 100644 (file)
@@ -1 +1 @@
-alt/base_closure_break_alt2.nit:26,3--7: Error: 'bar' arity missmatch.
+alt/base_closure_break_alt2.nit:26,3--7: Error: arity missmatch; prototype is 'bar'.
index 5ca9788..26c4634 100644 (file)
@@ -1 +1 @@
-alt/base_closure_raf_alt13.nit:27,3--8: Error: 'bar' arity missmatch.
+alt/base_closure_raf_alt13.nit:27,3--8: Error: arity missmatch; prototype is 'bar'.
index e7d1878..035b956 100644 (file)
@@ -1 +1 @@
-alt/base_closure_raf_alt2.nit:29,3--5: Error: 'bar' arity missmatch.
+alt/base_closure_raf_alt2.nit:29,3--5: Error: arity missmatch; prototype is 'bar(Int)'.
index 40af9db..cd16023 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt1.nit:51,1--3: Error: 'foo' arity missmatch.
+alt/base_vararg_alt1.nit:51,1--3: Error: arity missmatch; prototype is 'foo(Char)'.
index fc8b14f..e5b6952 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt2.nit:54,1--3: Error: 'bar' arity missmatch.
+alt/base_vararg_alt2.nit:54,1--3: Error: arity missmatch; prototype is 'bar(Char,Char)'.
index 7a7fbfe..847f95b 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt3.nit:55,1--7: Error: 'bar' arity missmatch.
+alt/base_vararg_alt3.nit:55,1--7: Error: arity missmatch; prototype is 'bar(Char,Char)'.
index 7858a66..19ae490 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt4.nit:58,1--3: Error: 'baz' arity missmatch.
+alt/base_vararg_alt4.nit:58,1--3: Error: arity missmatch; prototype is 'baz(Char,Char)'.
index 74bc803..ad539b9 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt5.nit:59,1--7: Error: 'baz' arity missmatch.
+alt/base_vararg_alt5.nit:59,1--7: Error: arity missmatch; prototype is 'baz(Char,Char)'.
index 04f59cc..7df8f14 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt6.nit:62,1--6: Error: 'foobar' arity missmatch.
+alt/base_vararg_alt6.nit:62,1--6: Error: arity missmatch; prototype is 'foobar(Char,Char,Char)'.
index 2e037d4..dd247e2 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt7.nit:63,1--10: Error: 'foobar' arity missmatch.
+alt/base_vararg_alt7.nit:63,1--10: Error: arity missmatch; prototype is 'foobar(Char,Char,Char)'.
index aca986c..b10307c 100644 (file)
@@ -1 +1 @@
-alt/base_vararg_alt8.nit:64,1--14: Error: 'foobar' arity missmatch.
+alt/base_vararg_alt8.nit:64,1--14: Error: arity missmatch; prototype is 'foobar(Char,Char,Char)'.
index 043b28f..aa1ab6a 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: 'trash' arity missmatch.
+alt/error_expr_not_ok_alt4.nit:50,1--10: Error: arity missmatch; prototype is 'trash(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 0dee678..12b1d7e 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: 'trash' arity missmatch.
+alt/error_expr_not_ok_alt5.nit:50,1--10: Error: arity missmatch; prototype is 'trash(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 39a09a4..20f98a5 100644 (file)
@@ -1,4 +1,4 @@
-./error_init_auto.nit:34,5--9: Error: 'init' arity missmatch.
-./error_init_auto.nit:36,5--14: Error: 'init' arity missmatch.
-./error_init_auto.nit:37,5--17: Error: 'init' arity missmatch.
+./error_init_auto.nit:34,5--9: Error: arity missmatch; prototype is 'init(Int)'.
+./error_init_auto.nit:36,5--14: Error: arity missmatch; prototype is 'init(Int)'.
+./error_init_auto.nit:37,5--17: Error: arity missmatch; prototype is 'init(Int)'.
 ./error_init_auto.nit:38,5--15: Error: Method 'foo' doesn't exists in A.
index 9e5a36d..fda8cc8 100644 (file)
@@ -1,4 +1,4 @@
-alt/error_init_auto_alt1.nit:34,5--11: Error: 'init' arity missmatch.
-alt/error_init_auto_alt1.nit:35,5--14: Error: 'init' arity missmatch.
-alt/error_init_auto_alt1.nit:36,5--17: Error: 'init' arity missmatch.
+alt/error_init_auto_alt1.nit:34,5--11: Error: arity missmatch; prototype is 'init'.
+alt/error_init_auto_alt1.nit:35,5--14: Error: arity missmatch; prototype is 'init'.
+alt/error_init_auto_alt1.nit:36,5--17: Error: arity missmatch; prototype is 'init'.
 alt/error_init_auto_alt1.nit:37,5--15: Error: Method 'foo' doesn't exists in A.
index 839cda3..9a24c04 100644 (file)
@@ -1,4 +1,4 @@
-alt/error_init_auto_alt2.nit:33,5--9: Error: 'init' arity missmatch.
-alt/error_init_auto_alt2.nit:34,5--11: Error: 'init' arity missmatch.
-alt/error_init_auto_alt2.nit:36,5--17: Error: 'init' arity missmatch.
+alt/error_init_auto_alt2.nit:33,5--9: Error: arity missmatch; prototype is 'init(Int,Int)'.
+alt/error_init_auto_alt2.nit:34,5--11: Error: arity missmatch; prototype is 'init(Int,Int)'.
+alt/error_init_auto_alt2.nit:36,5--17: Error: arity missmatch; prototype is 'init(Int,Int)'.
 alt/error_init_auto_alt2.nit:37,5--15: Error: Method 'foo' doesn't exists in A.
index bd9cc2d..d5defda 100644 (file)
@@ -1,4 +1,4 @@
-alt/error_init_auto_alt3.nit:34,5--9: Error: 'init' arity missmatch.
-alt/error_init_auto_alt3.nit:36,5--14: Error: 'init' arity missmatch.
-alt/error_init_auto_alt3.nit:37,5--17: Error: 'init' arity missmatch.
+alt/error_init_auto_alt3.nit:34,5--9: Error: arity missmatch; prototype is 'init(Int)'.
+alt/error_init_auto_alt3.nit:36,5--14: Error: arity missmatch; prototype is 'init(Int)'.
+alt/error_init_auto_alt3.nit:37,5--17: Error: arity missmatch; prototype is 'init(Int)'.
 alt/error_init_auto_alt3.nit:38,5--15: Error: Method 'foo' doesn't exists in A.