Report undefined interface errors before checking implemented interfaces
This commit is contained in:
parent
03413ab0d4
commit
df676ff6e9
@ -855,6 +855,8 @@ infer1(Env, [{Contract, Ann, ConName, Impls, Code} | Rest], Acc, Options)
|
||||
_ -> ok
|
||||
end
|
||||
end, Impls),
|
||||
destroy_and_report_type_errors(Env),
|
||||
create_type_errors(),
|
||||
case What of
|
||||
contract ->
|
||||
ImplementedInterfaces = [proplists:get_value(Name, AllInterfaces) || Name <- ImplsNames],
|
||||
|
@ -844,6 +844,10 @@ failing_contracts() ->
|
||||
"Unimplemented function f from the interface J in the contract C">>
|
||||
])
|
||||
, ?TYPE_ERROR(contract_polymorphism_undefined_interface,
|
||||
[<<?Pos(1,14)
|
||||
"Trying to implement or extend an undefined interface I at line 1, column 14">>
|
||||
])
|
||||
, ?TYPE_ERROR(contract_interface_polymorphism_undefined_interface,
|
||||
[<<?Pos(1,24)
|
||||
"Trying to implement or extend an undefined interface H at line 1, column 24">>
|
||||
])
|
||||
|
@ -0,0 +1,5 @@
|
||||
contract interface I : H =
|
||||
entrypoint f : () => unit
|
||||
|
||||
contract C =
|
||||
entrypoint g() = ()
|
@ -1,5 +1,2 @@
|
||||
contract interface I : H =
|
||||
entrypoint f : () => unit
|
||||
|
||||
contract C =
|
||||
entrypoint g() = ()
|
||||
contract C : I =
|
||||
entrypoint f() = ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user