Handle all user generated code errors in the type checker #885

Merged
ghallak merged 15 commits from ghallak/270 into master 2022-07-26 00:48:47 +09:00
5 changed files with 22 additions and 5 deletions
Showing only changes of commit 6b309c9381 - Show all commits

View File

@ -208,6 +208,7 @@ compilable_contracts() ->
"polymorphism_contract_interface_extensions",
"polymorphism_contract_interface_same_decl_multi_interface",
"polymorphism_contract_interface_same_name_same_type",
"missing_init_fun_state_unit",
"test" % Custom general-purpose test file. Keep it last on the list.
].
@ -1035,9 +1036,14 @@ failing_contracts() ->
[<<?Pos(3,12)
"The event type cannot be parameterized">>
])
, ?TYPE_ERROR(missing_init_function,
, ?TYPE_ERROR(missing_init_fun_alias_to_type,
[<<?Pos(1,10)
"Missing `init` function for the contract `MissingInitFunction`.\n"
"Missing `init` function for the contract `AliasToType`.\n"
"The `init` function can only be omitted if the state type is `unit`">>
])
, ?TYPE_ERROR(missing_init_fun_alias_to_alias_to_type,
[<<?Pos(1,10)
"Missing `init` function for the contract `AliasToAliasToType`.\n"
"The `init` function can only be omitted if the state type is `unit`">>
])
].

View File

@ -0,0 +1,3 @@
contract AliasToAliasToType =
type alias = int * int
type state = alias

View File

@ -0,0 +1,2 @@
contract AliasToType =
type state = int * int

View File

@ -0,0 +1,9 @@
contract AliasToAliasToUnit =
type alias = unit
type state = alias
contract AliasToUnit =
type state = unit
main contract ImplicitState =
type sometype = int

View File

@ -1,3 +0,0 @@
contract MissingInitFunction =
type state = int * int