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:
@@ -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
|
||||
@@ -0,0 +1,4 @@
|
||||
main contract C =
|
||||
stateful entrypoint f() =
|
||||
let x = Chain.clone
|
||||
123
|
||||
Reference in New Issue
Block a user