mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
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.
13 lines
100 B
Go
13 lines
100 B
Go
package main
|
|
|
|
const a = 64
|
|
|
|
var b uint = a * a / 2
|
|
|
|
func main() {
|
|
println(b)
|
|
}
|
|
|
|
// Output:
|
|
// 2048
|