Polymorphism support #848

Merged
ghallak merged 53 commits from ghallak/307 into master 2022-06-17 18:09:07 +09:00
3 changed files with 27 additions and 0 deletions
Showing only changes of commit 88666a36d2 - Show all commits

View File

@ -836,6 +836,16 @@ failing_contracts() ->
[<<?Pos(7,10) [<<?Pos(7,10)
"Unimplemented function f from the interface I in the contract C">> "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, , ?TYPE_ERROR(contract_polymorphism_missing_implementation,
[<<?Pos(7,10) [<<?Pos(7,10)
"Unimplemented function f from the interface I1 in the contract C">> "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