compiler: support iota

This commit is contained in:
Evgenii Stratonikov 2020-08-25 10:22:58 +03:00
parent d8badd9a8d
commit 05ef951055
2 changed files with 20 additions and 1 deletions

View file

@ -72,3 +72,17 @@ func TestGlobalsWithFunctionParams(t *testing.T) {
`
eval(t, src, []byte("FOO"))
}
func TestIota(t *testing.T) {
src := `package foo
const (
a = 2 << iota
b
c = 11
)
func Main() int {
return a + b + c
}`
eval(t, src, big.NewInt(17))
}