diff options
author | Russ Cox <rsc@golang.org> | 2012-02-11 00:50:56 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2012-02-11 00:50:56 -0500 |
commit | 337547d1c997a11266c967e27ac7bc6c611b6372 (patch) | |
tree | 1b958da34312698d3737fd2871b9f5add448a7a1 /test/const2.go | |
parent | 2233942e3c030acffda5952ee3677bedaebf6079 (diff) | |
download | go-337547d1c997a11266c967e27ac7bc6c611b6372.tar.gz go-337547d1c997a11266c967e27ac7bc6c611b6372.zip |
gc: make constant arith errors a little more friendly
Fixes #2804.
R=ken2
CC=golang-dev
https://golang.org/cl/5652067
Diffstat (limited to 'test/const2.go')
-rw-r--r-- | test/const2.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/const2.go b/test/const2.go index bea1b99125..b0837354ab 100644 --- a/test/const2.go +++ b/test/const2.go @@ -10,3 +10,7 @@ const ( A int = 1 B byte; // ERROR "type without expr|expected .=." ) + +const LargeA = 1000000000000000000 +const LargeB = LargeA * LargeA * LargeA +const LargeC = LargeB * LargeB * LargeB // ERROR "constant multiplication overflow" |