In unary constant operations, the test for unsigned was defeated by testing for int first, which is true also for unsigned. Make sure that testing for unsigned precedes testing for int. Fixes #907.
13 lines
142 B
Go
13 lines
142 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
const maxLen = int64(int(^uint(0) >> 1))
|
|
|
|
func main() {
|
|
fmt.Println(maxLen)
|
|
}
|
|
|
|
// Output:
|
|
// 9223372036854775807
|