-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: fix operators working on integer constants
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
- Loading branch information
Showing
3 changed files
with
37 additions
and
17 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,15 @@ | ||
package main | ||
|
||
const ( | ||
numDec uint8 = (1 << iota) / 2 | ||
numHex | ||
numOct | ||
numFloat | ||
) | ||
|
||
func main() { | ||
println(13 & (numHex | numOct)) | ||
} | ||
|
||
// Output: | ||
// 1 |
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.