vm/emit: emit Boolean values correctly

We should convert both `true` and `false` values.
This commit is contained in:
Evgeniy Stratonikov 2021-03-09 13:17:21 +03:00
parent 3e54b46ffb
commit 55009153a9
9 changed files with 39 additions and 20 deletions

View file

@ -361,3 +361,15 @@ func TestShortCircuit(t *testing.T) {
eval(t, src, big.NewInt(17))
})
}
func TestEmitBoolean(t *testing.T) {
src := `package foo
func Main() int {
a := true
if (a == true) == true {
return 42
}
return 11
}`
eval(t, src, big.NewInt(42))
}