summaryrefslogtreecommitdiff
path: root/test/shift1.go
diff options
context:
space:
mode:
authorR?my Oudompheng <oudomphe@phare.normalesup.org>2013-03-16 00:37:28 +0100
committerR?my Oudompheng <oudomphe@phare.normalesup.org>2013-03-16 00:37:28 +0100
commitf9909453d4d203d94b89a1fb42a05af74bb17305 (patch)
tree151421a71802f35df54f109a09a3ad58f39d7488 /test/shift1.go
parent9efbaf94cd0ec42715a22bd92d50851cdb0605ab (diff)
downloadgo-f9909453d4d203d94b89a1fb42a05af74bb17305.tar.gz
cmd/gc: missing type inference for untyped complex() calls.
Fixes issue 5014. R=golang-dev, r, rsc, daniel.morsing CC=golang-dev https://codereview.appspot.com/7664043
Diffstat (limited to 'test/shift1.go')
-rw-r--r--test/shift1.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/shift1.go b/test/shift1.go
index f1ec0bf58..46867a933 100644
--- a/test/shift1.go
+++ b/test/shift1.go
@@ -42,4 +42,16 @@ var (
a3 = 1.0<<s + 0 // ERROR "invalid operation|shift of non-integer operand"
// issue 4937
b3 = 1<<s + 1 + 1.0 // ERROR "invalid operation|shift of non-integer operand"
+ // issue 5014
+ c3 = complex(1<<s, 0) // ERROR "shift of type float64"
+ d3 int = complex(1<<s, 3) // ERROR "cannot use.*as type int" "shift of type float64"
+ e3 = real(1 << s) // ERROR "invalid"
+ f3 = imag(1 << s) // ERROR "invalid"
+)
+
+var (
+ a4 float64
+ b4 int
+ c4 = complex(1<<s, a4) // ERROR "shift of type float64"
+ d4 = complex(1<<s, b4) // ERROR "invalid"
)