Pattern guards for functions and switch statements #830

Merged
ghallak merged 23 commits from ghallak/232 into master 2021-10-20 17:04:01 +09:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit 2d8db5f4ce - Show all commits

View File

@ -813,6 +813,9 @@ failing_contracts() ->
[<<?Pos(8,12) [<<?Pos(8,12)
"Cannot reference stateful function g (at line 8, column 12) in a pattern guard.">> "Cannot reference stateful function g (at line 8, column 12) in a pattern guard.">>
]) ])
, ?TYPE_ERROR(non_boolean_pattern_guard,
[<<?Pos(4,24)
"Cannot unify string\n and bool\nwhen checking the type of the expression at line 4, column 24\n \"y\" : string\nagainst the expected type\n bool">>
]) ])
]. ].

View File

@ -0,0 +1,4 @@
contract C =
type state = int
entrypoint init(x) | "y" = 1