Files
yaegi/_test/const21.go
T
Marc Vertes 513f5e37aa interp: fix type conversion for constant expressions
The case of a constant arithmetic expression being of float kind because
of quotient was not handled correctly. Simplify constant extraction to
reflect.Value first, then conversion to target type, and let reflect Convert
method panic if conversion is not valid.

Fixes #920.
2020-10-23 10:44:04 +02:00

13 lines
100 B
Go

package main
const a = 64
var b uint = a * a / 2
func main() {
println(b)
}
// Output:
// 2048