compiler: allow to use switch without tag

This commit is contained in:
Evgenii Stratonikov 2020-08-24 18:55:30 +03:00
parent e58616b975
commit 354645fbe3
2 changed files with 22 additions and 3 deletions

View file

@ -18,6 +18,21 @@ var switchTestCases = []testCase{
}`,
big.NewInt(2),
},
{
"switch with no tag",
`package main
func f() bool { return false }
func Main() int {
switch {
case f():
return 1
case true:
return 2
}
return 3
}`,
big.NewInt(2),
},
{
"simple switch fail",
`package main