Add failing tests
This commit is contained in:
parent
d063040ac1
commit
ed2ef02d68
@ -3768,7 +3768,7 @@ mk_error({unpreserved_payablity, Kind, ContractCon, InterfaceCon}) ->
|
|||||||
contract -> "contract";
|
contract -> "contract";
|
||||||
contract_interface -> "interface"
|
contract_interface -> "interface"
|
||||||
end,
|
end,
|
||||||
Msg = io_lib:format("Non-payable ~s ~s cannot implement payable interface ~s",
|
Msg = io_lib:format("Non-payable ~s `~s` cannot implement payable interface `~s`",
|
||||||
[KindStr, name(ContractCon), name(InterfaceCon)]),
|
[KindStr, name(ContractCon), name(InterfaceCon)]),
|
||||||
mk_t_err(pos(ContractCon), Msg);
|
mk_t_err(pos(ContractCon), Msg);
|
||||||
mk_error(Err) ->
|
mk_error(Err) ->
|
||||||
|
@ -1155,6 +1155,26 @@ failing_contracts() ->
|
|||||||
"to arguments\n"
|
"to arguments\n"
|
||||||
" `Chain.create : (value : int, var_args) => 'c`">>
|
" `Chain.create : (value : int, var_args) => 'c`">>
|
||||||
])
|
])
|
||||||
|
, ?TYPE_ERROR(polymorphism_add_stateful_entrypoint,
|
||||||
|
[<<?Pos(5,25)
|
||||||
|
"`f` cannot be stateful because the entrypoint `f` in the interface `I` is not stateful">>
|
||||||
|
])
|
||||||
|
, ?TYPE_ERROR(polymorphism_change_entrypoint_to_function,
|
||||||
|
[<<?Pos(6,14)
|
||||||
|
"`f` must be declared as an entrypoint instead of a function in order to implement the entrypoint `f` from the interface `I`">>
|
||||||
|
])
|
||||||
|
, ?TYPE_ERROR(polymorphism_non_payable_contract_implement_payable,
|
||||||
|
[<<?Pos(4,10)
|
||||||
|
"Non-payable contract `C` cannot implement payable interface `I`">>
|
||||||
|
])
|
||||||
|
, ?TYPE_ERROR(polymorphism_non_payable_interface_implement_payable,
|
||||||
|
[<<?Pos(4,20)
|
||||||
|
"Non-payable interface `H` cannot implement payable interface `I`">>
|
||||||
|
])
|
||||||
|
, ?TYPE_ERROR(polymorphism_remove_payable_entrypoint,
|
||||||
|
[<<?Pos(5,16)
|
||||||
|
"`f` must be payable because the entrypoint `f` in the interface `I` is payable">>
|
||||||
|
])
|
||||||
].
|
].
|
||||||
|
|
||||||
validation_test_() ->
|
validation_test_() ->
|
||||||
|
5
test/contracts/polymorphism_add_stateful_entrypoint.aes
Normal file
5
test/contracts/polymorphism_add_stateful_entrypoint.aes
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
contract interface I =
|
||||||
|
entrypoint f : () => int
|
||||||
|
|
||||||
|
contract C : I =
|
||||||
|
stateful entrypoint f() = 1
|
@ -0,0 +1,6 @@
|
|||||||
|
contract interface I =
|
||||||
|
entrypoint f : () => int
|
||||||
|
|
||||||
|
contract C : I =
|
||||||
|
entrypoint init() = ()
|
||||||
|
function f() = 1
|
@ -0,0 +1,5 @@
|
|||||||
|
payable contract interface I =
|
||||||
|
payable entrypoint f : () => int
|
||||||
|
|
||||||
|
contract C : I =
|
||||||
|
entrypoint f() = 123
|
@ -0,0 +1,8 @@
|
|||||||
|
payable contract interface I =
|
||||||
|
payable entrypoint f : () => int
|
||||||
|
|
||||||
|
contract interface H : I =
|
||||||
|
payable entrypoint f : () => int
|
||||||
|
|
||||||
|
payable contract C : H =
|
||||||
|
entrypoint f() = 123
|
@ -0,0 +1,5 @@
|
|||||||
|
contract interface I =
|
||||||
|
payable entrypoint f : () => int
|
||||||
|
|
||||||
|
contract C : I =
|
||||||
|
entrypoint f() = 1
|
Loading…
x
Reference in New Issue
Block a user