Add test for non-boolean guards

This commit is contained in:
Gaith Hallak 2021-10-10 20:08:39 +03:00
parent 2a15626c3c
commit 2d8db5f4ce
2 changed files with 7 additions and 0 deletions

View File

@ -813,6 +813,9 @@ failing_contracts() ->
[<<?Pos(8,12)
"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