-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: fix type check in constant unary operations
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.
- Loading branch information
Showing
3 changed files
with
20 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
const maxLen = int64(int(^uint(0) >> 1)) | ||
|
||
func main() { | ||
fmt.Println(maxLen) | ||
} | ||
|
||
// Output: | ||
// 9223372036854775807 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.