Ban the unification of uvars and var_args functions (#423)

* Ban the unification of uvar and var_args function

* Update CHANGELOG

* Fix the tests

* Undo indent

* Change the error message for unify_varargs
This commit is contained in:
Gaith Hallak
2022-11-01 18:10:57 +02:00
committed by GitHub
parent 4ca90feea0
commit 83abfae32b
6 changed files with 33 additions and 2 deletions
+13
View File
@@ -1139,6 +1139,19 @@ failing_contracts() ->
" `oracle(string, (int) => int)`\n"
"The response type must not be higher-order (contain function types)">>
])
, ?TYPE_ERROR(var_args_unify_let,
[<<?Pos(3,9)
"Cannot infer types for variable argument list.\n"
"when checking the type of the pattern `x : 'a` against the expected type `(gas : int, value : int, protected : bool, ref : 'b, var_args) => 'b`">>
])
, ?TYPE_ERROR(var_args_unify_fun_call,
[<<?Pos(6,5)
"Cannot infer types for variable argument list.\n"
"when checking the application of\n"
" `g : (() => 'b) => 'b`\n"
"to arguments\n"
" `Chain.create : (value : int, var_args) => 'c`">>
])
].
validation_test_() ->
@@ -0,0 +1,7 @@
contract C =
stateful function g(h) =
h()
stateful entrypoint f() =
g(Chain.create)
123
+4
View File
@@ -0,0 +1,4 @@
main contract C =
stateful entrypoint f() =
let x = Chain.clone
123