Instant unification error on arguments count mismatch #716

Merged
zxq9 merged 3 commits from github/fork/radrow/no-arg-pp-fix into lima 2020-02-21 18:28:56 +09:00
2 changed files with 27 additions and 0 deletions
Showing only changes of commit f2af3f96f7 - Show all commits

View File

@ -623,6 +623,28 @@ failing_contracts() ->
"Empty record/map update\n"
" r {}">>
])
, ?TYPE_ERROR(bad_number_of_args,
[<<?Pos(3, 39)
"Cannot unify () => unit\n"
" and (int) => 'a\n",
"when checking the application at line 3, column 39 of\n"
" f : () => unit\n"
"to arguments\n"
" 1 : int">>,
<<?Pos(4, 20)
"Cannot unify (int, string) => 'e\n"
" and (int) => 'd\n"
"when checking the application at line 4, column 20 of\n"
" g : (int, string) => 'e\n"
"to arguments\n"
" 1 : int">>,
<<?Pos(5, 20)
"Cannot unify (int, string) => 'c\n"
" and (string) => 'b\n"
"when checking the application at line 5, column 20 of\n"
" g : (int, string) => 'c\nto arguments\n"
" \"Litwo, ojczyzno moja\" : string">>
])
].
-define(Path(File), "code_errors/" ??File).

View File

@ -0,0 +1,5 @@
contract Test =
entrypoint f() = ()
entrypoint g(x : int, y : string) = f(1)
entrypoint h() = g(1)
entrypoint i() = g("Litwo, ojczyzno moja")