Add tests for interfaces implementing interfaces

This commit is contained in:
Gaith Hallak 2021-12-18 19:20:45 +02:00
parent adb3455f25
commit 88666a36d2
3 changed files with 27 additions and 0 deletions

View File

@ -836,6 +836,16 @@ failing_contracts() ->
[<<?Pos(7,10)
"Unimplemented function f from the interface I in the contract C">>
])
, ?TYPE_ERROR(contract_interface_polymorphism_same_name_same_type,
[<<?Pos(7,10)
"Unimplemented function f from the interface I1 in the contract C">>
])
, ?TYPE_ERROR(contract_interface_polymorphism_same_name_different_type,
[<<?Pos(9,5)
"Duplicate definitions of f at\n"
" - line 8, column 5\n"
" - line 9, column 5">>
])
, ?TYPE_ERROR(contract_polymorphism_missing_implementation,
[<<?Pos(7,10)
"Unimplemented function f from the interface I1 in the contract C">>

View File

@ -0,0 +1,9 @@
contract interface I1 =
entrypoint f : () => int
contract interface I2 : I1 =
entrypoint f : () => char
contract C : I2 =
entrypoint f() = 1
entrypoint f() = 'c'

View File

@ -0,0 +1,8 @@
contract interface I1 =
entrypoint f : () => int
contract interface I2 : I1 =
entrypoint f : () => int
contract C : I2 =
entrypoint f() = 1