mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
Always attempt to obtain an integer constant value for operators expecting so. It allows to use '/' in integer constant defintions, instead of default big.Rat. Fixes #1005
16 lines
149 B
Go
16 lines
149 B
Go
package main
|
|
|
|
const (
|
|
numDec uint8 = (1 << iota) / 2
|
|
numHex
|
|
numOct
|
|
numFloat
|
|
)
|
|
|
|
func main() {
|
|
println(13 & (numHex | numOct))
|
|
}
|
|
|
|
// Output:
|
|
// 1
|