2012-02-16 21:51:04 -07:00
|
|
|
// errorcheck
|
2011-05-25 11:26:06 -06:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
2011-05-25 11:26:06 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2012-02-23 17:48:19 -07:00
|
|
|
// Test illegal shifts.
|
2011-05-25 11:26:06 -06:00
|
|
|
// Issue 1708, illegal cases.
|
2012-02-23 17:48:19 -07:00
|
|
|
// Does not compile.
|
2011-05-25 11:26:06 -06:00
|
|
|
|
|
|
|
package p
|
|
|
|
|
|
|
|
func f(x int) int { return 0 }
|
|
|
|
func g(x interface{}) int { return 0 }
|
|
|
|
func h(x float64) int { return 0 }
|
|
|
|
|
|
|
|
// from the spec
|
|
|
|
var (
|
|
|
|
s uint = 33
|
2011-09-21 18:25:48 -06:00
|
|
|
u = 1.0 << s // ERROR "invalid operation|shift of non-integer operand"
|
cmd/compile: rewrite untyped constant conversion logic
This CL detangles the hairy mess that was convlit+defaultlit. In
particular, it makes the following changes:
1. convlit1 now follows the standard typecheck behavior of setting
"n.Type = nil" if there's an error. Notably, this means for a lot of
test cases, we now avoid reporting useless follow-on error messages.
For example, after reporting that "1 << s + 1.0" has an invalid shift,
we no longer also report that it can't be assigned to string.
2. Previously, assignconvfn had some extra logic for trying to
suppress errors from convlit/defaultlit so that it could provide its
own errors with better context information. Instead, this extra
context information is now passed down into convlit1 directly.
3. Relatedly, this CL also removes redundant calls to defaultlit prior
to assignconv. As a consequence, when an expression doesn't make sense
for a particular assignment (e.g., assigning an untyped string to an
integer), the error messages now say "untyped string" instead of just
"string". This is more consistent with go/types behavior.
4. defaultlit2 is now smarter about only trying to convert pairs of
untyped constants when it's likely to succeed. This allows us to
report better error messages for things like 3+"x"; instead of "cannot
convert 3 to string" we now report "mismatched types untyped number
and untyped string".
Passes toolstash-check.
Change-Id: I26822a02dc35855bd0ac774907b1cf5737e91882
Reviewed-on: https://go-review.googlesource.com/c/go/+/187657
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-09-05 14:33:06 -06:00
|
|
|
v float32 = 1 << s // ERROR "invalid"
|
2011-05-25 11:26:06 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// non-constant shift expressions
|
|
|
|
var (
|
cmd/compile: rewrite untyped constant conversion logic
This CL detangles the hairy mess that was convlit+defaultlit. In
particular, it makes the following changes:
1. convlit1 now follows the standard typecheck behavior of setting
"n.Type = nil" if there's an error. Notably, this means for a lot of
test cases, we now avoid reporting useless follow-on error messages.
For example, after reporting that "1 << s + 1.0" has an invalid shift,
we no longer also report that it can't be assigned to string.
2. Previously, assignconvfn had some extra logic for trying to
suppress errors from convlit/defaultlit so that it could provide its
own errors with better context information. Instead, this extra
context information is now passed down into convlit1 directly.
3. Relatedly, this CL also removes redundant calls to defaultlit prior
to assignconv. As a consequence, when an expression doesn't make sense
for a particular assignment (e.g., assigning an untyped string to an
integer), the error messages now say "untyped string" instead of just
"string". This is more consistent with go/types behavior.
4. defaultlit2 is now smarter about only trying to convert pairs of
untyped constants when it's likely to succeed. This allows us to
report better error messages for things like 3+"x"; instead of "cannot
convert 3 to string" we now report "mismatched types untyped number
and untyped string".
Passes toolstash-check.
Change-Id: I26822a02dc35855bd0ac774907b1cf5737e91882
Reviewed-on: https://go-review.googlesource.com/c/go/+/187657
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-09-05 14:33:06 -06:00
|
|
|
e1 = g(2.0 << s) // ERROR "invalid|shift of non-integer operand"
|
|
|
|
f1 = h(2 << s) // ERROR "invalid"
|
2021-11-27 11:33:59 -07:00
|
|
|
g1 int64 = 1.1 << s // ERROR "truncated|must be integer"
|
2011-05-25 11:26:06 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// constant shift expressions
|
|
|
|
const c uint = 65
|
|
|
|
|
|
|
|
var (
|
|
|
|
a2 int = 1.0 << c // ERROR "overflow"
|
|
|
|
b2 = 1.0 << c // ERROR "overflow"
|
|
|
|
d2 = f(1.0 << c) // ERROR "overflow"
|
|
|
|
)
|
2013-03-04 08:51:42 -07:00
|
|
|
|
|
|
|
var (
|
|
|
|
// issues 4882, 4936.
|
2013-06-26 09:23:52 -06:00
|
|
|
a3 = 1.0<<s + 0 // ERROR "invalid|shift of non-integer operand"
|
2013-03-04 08:51:42 -07:00
|
|
|
// issue 4937
|
2013-06-26 09:23:52 -06:00
|
|
|
b3 = 1<<s + 1 + 1.0 // ERROR "invalid|shift of non-integer operand"
|
2013-03-15 17:37:28 -06:00
|
|
|
// issue 5014
|
2013-06-26 09:23:52 -06:00
|
|
|
c3 = complex(1<<s, 0) // ERROR "invalid|shift of type float64"
|
2021-11-27 11:33:59 -07:00
|
|
|
d3 int = complex(1<<s, 3) // ERROR "non-integer|cannot use.*as type int" "shift of type float64|must be integer"
|
2013-03-15 17:37:28 -06:00
|
|
|
e3 = real(1 << s) // ERROR "invalid"
|
|
|
|
f3 = imag(1 << s) // ERROR "invalid"
|
|
|
|
)
|
|
|
|
|
2013-03-21 17:56:59 -06:00
|
|
|
// from the spec
|
|
|
|
func _() {
|
|
|
|
var (
|
|
|
|
s uint = 33
|
|
|
|
i = 1 << s // 1 has type int
|
|
|
|
j int32 = 1 << s // 1 has type int32; j == 0
|
|
|
|
k = uint64(1 << s) // 1 has type uint64; k == 1<<33
|
|
|
|
m int = 1.0 << s // 1.0 has type int
|
|
|
|
n = 1.0<<s != i // 1.0 has type int; n == false if ints are 32bits in size
|
|
|
|
o = 1<<s == 2<<s // 1 and 2 have type int; o == true if ints are 32bits in size
|
|
|
|
// next test only fails on 32bit systems
|
|
|
|
// p = 1<<s == 1<<33 // illegal if ints are 32bits in size: 1 has type int, but 1<<33 overflows int
|
2013-06-26 09:23:52 -06:00
|
|
|
u = 1.0 << s // ERROR "non-integer|float64"
|
|
|
|
u1 = 1.0<<s != 0 // ERROR "non-integer|float64"
|
|
|
|
u2 = 1<<s != 1.0 // ERROR "non-integer|float64"
|
|
|
|
v float32 = 1 << s // ERROR "non-integer|float32"
|
2013-03-21 17:56:59 -06:00
|
|
|
w int64 = 1.0 << 33 // 1.0<<33 is a constant shift expression
|
cmd/compile: rewrite untyped constant conversion logic
This CL detangles the hairy mess that was convlit+defaultlit. In
particular, it makes the following changes:
1. convlit1 now follows the standard typecheck behavior of setting
"n.Type = nil" if there's an error. Notably, this means for a lot of
test cases, we now avoid reporting useless follow-on error messages.
For example, after reporting that "1 << s + 1.0" has an invalid shift,
we no longer also report that it can't be assigned to string.
2. Previously, assignconvfn had some extra logic for trying to
suppress errors from convlit/defaultlit so that it could provide its
own errors with better context information. Instead, this extra
context information is now passed down into convlit1 directly.
3. Relatedly, this CL also removes redundant calls to defaultlit prior
to assignconv. As a consequence, when an expression doesn't make sense
for a particular assignment (e.g., assigning an untyped string to an
integer), the error messages now say "untyped string" instead of just
"string". This is more consistent with go/types behavior.
4. defaultlit2 is now smarter about only trying to convert pairs of
untyped constants when it's likely to succeed. This allows us to
report better error messages for things like 3+"x"; instead of "cannot
convert 3 to string" we now report "mismatched types untyped number
and untyped string".
Passes toolstash-check.
Change-Id: I26822a02dc35855bd0ac774907b1cf5737e91882
Reviewed-on: https://go-review.googlesource.com/c/go/+/187657
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-09-05 14:33:06 -06:00
|
|
|
|
2013-06-26 09:23:52 -06:00
|
|
|
_, _, _, _, _, _, _, _, _, _ = j, k, m, n, o, u, u1, u2, v, w
|
2013-03-21 17:56:59 -06:00
|
|
|
)
|
2017-04-22 07:28:58 -06:00
|
|
|
|
|
|
|
// non constants arguments trigger a different path
|
|
|
|
f2 := 1.2
|
|
|
|
s2 := "hi"
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = f2 << 2 // ERROR "shift of type float64|non-integer|must be integer"
|
|
|
|
_ = s2 << 2 // ERROR "shift of type string|non-integer|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// shifts in comparisons w/ untyped operands
|
2013-03-15 17:37:28 -06:00
|
|
|
var (
|
2013-03-21 17:56:59 -06:00
|
|
|
_ = 1<<s == 1
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1<<s == 1. // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s == 1 // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s == 1. // ERROR "invalid|non-integer|shift of type float64"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = 1<<s+1 == 1
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1<<s+1 == 1. // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1. == 1 // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1. == 1. // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1 == 1 // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1 == 1. // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1. == 1 // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1. == 1. // ERROR "invalid|non-integer|shift of type float64"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = 1<<s == 1<<s
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1<<s == 1.<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s == 1<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s == 1.<<s // ERROR "invalid|non-integer|shift of type float64"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = 1<<s+1<<s == 1
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1<<s+1<<s == 1. // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1.<<s == 1 // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1.<<s == 1. // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1<<s == 1 // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1<<s == 1. // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1.<<s == 1 // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1.<<s == 1. // ERROR "invalid|non-integer|shift of type float64"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = 1<<s+1<<s == 1<<s+1<<s
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1<<s+1<<s == 1<<s+1.<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1<<s == 1.<<s+1<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1<<s == 1.<<s+1.<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1.<<s == 1<<s+1<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1.<<s == 1<<s+1.<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1.<<s == 1.<<s+1<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1<<s+1.<<s == 1.<<s+1.<<s // ERROR "invalid|non-integer|shift of type float64"
|
|
|
|
_ = 1.<<s+1<<s == 1<<s+1<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1<<s == 1<<s+1.<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1<<s == 1.<<s+1<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1<<s == 1.<<s+1.<<s // ERROR "invalid|non-integer|shift of type float64"
|
|
|
|
_ = 1.<<s+1.<<s == 1<<s+1<<s // ERROR "invalid|shift of type float64"
|
|
|
|
_ = 1.<<s+1.<<s == 1<<s+1.<<s // ERROR "invalid|non-integer|shift of type float64"
|
|
|
|
_ = 1.<<s+1.<<s == 1.<<s+1<<s // ERROR "invalid|non-integer|shift of type float64"
|
|
|
|
_ = 1.<<s+1.<<s == 1.<<s+1.<<s // ERROR "invalid|non-integer|shift of type float64"
|
2013-03-04 08:51:42 -07:00
|
|
|
)
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
// shifts in comparisons w/ typed operands
|
|
|
|
var (
|
|
|
|
x int
|
|
|
|
_ = 1<<s == x
|
|
|
|
_ = 1.<<s == x
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = 1.1<<s == x // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = 1<<s+x == 1
|
|
|
|
_ = 1<<s+x == 1.
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1<<s+x == 1.1 // ERROR "truncated"
|
2013-03-21 17:56:59 -06:00
|
|
|
_ = 1.<<s+x == 1
|
|
|
|
_ = 1.<<s+x == 1.
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1.<<s+x == 1.1 // ERROR "truncated"
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = 1.1<<s+x == 1 // ERROR "truncated|must be integer"
|
|
|
|
_ = 1.1<<s+x == 1. // ERROR "truncated|must be integer"
|
|
|
|
_ = 1.1<<s+x == 1.1 // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = 1<<s == x<<s
|
|
|
|
_ = 1.<<s == x<<s
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = 1.1<<s == x<<s // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// shifts as operands in non-arithmetic operations and as arguments
|
|
|
|
func _() {
|
|
|
|
var s uint
|
|
|
|
var a []int
|
|
|
|
_ = a[1<<s]
|
|
|
|
_ = a[1.]
|
2017-11-30 16:47:46 -07:00
|
|
|
_ = a[1.<<s]
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = a[1.1<<s] // ERROR "integer|shift of type float64"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = make([]int, 1)
|
|
|
|
_ = make([]int, 1.)
|
|
|
|
_ = make([]int, 1.<<s)
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = make([]int, 1.1<<s) // ERROR "non-integer|truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = float32(1)
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = float32(1 << s) // ERROR "non-integer|shift of type float32|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
_ = float32(1.)
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = float32(1. << s) // ERROR "non-integer|shift of type float32|must be integer"
|
|
|
|
_ = float32(1.1 << s) // ERROR "non-integer|shift of type float32|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = append(a, 1<<s)
|
|
|
|
_ = append(a, 1.<<s)
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = append(a, 1.1<<s) // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
var b []float32
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = append(b, 1<<s) // ERROR "non-integer|type float32"
|
|
|
|
_ = append(b, 1.<<s) // ERROR "non-integer|type float32"
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = append(b, 1.1<<s) // ERROR "non-integer|type float32|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = complex(1.<<s, 0) // ERROR "non-integer|shift of type float64|must be integer"
|
|
|
|
_ = complex(1.1<<s, 0) // ERROR "non-integer|shift of type float64|must be integer"
|
|
|
|
_ = complex(0, 1.<<s) // ERROR "non-integer|shift of type float64|must be integer"
|
|
|
|
_ = complex(0, 1.1<<s) // ERROR "non-integer|shift of type float64|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
var a4 float64
|
|
|
|
var b4 int
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = complex(1<<s, a4) // ERROR "non-integer|shift of type float64|must be integer"
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = complex(1<<s, b4) // ERROR "invalid|non-integer|"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
var m1 map[int]string
|
|
|
|
delete(m1, 1<<s)
|
|
|
|
delete(m1, 1.<<s)
|
2021-11-27 11:33:59 -07:00
|
|
|
delete(m1, 1.1<<s) // ERROR "truncated|shift of type float64|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
var m2 map[float32]string
|
|
|
|
delete(m2, 1<<s) // ERROR "invalid|cannot use 1 << s as type float32"
|
|
|
|
delete(m2, 1.<<s) // ERROR "invalid|cannot use 1 << s as type float32"
|
|
|
|
delete(m2, 1.1<<s) // ERROR "invalid|cannot use 1.1 << s as type float32"
|
|
|
|
}
|
|
|
|
|
|
|
|
// shifts of shifts
|
|
|
|
func _() {
|
|
|
|
var s uint
|
|
|
|
_ = 1 << (1 << s)
|
|
|
|
_ = 1 << (1. << s)
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = 1 << (1.1 << s) // ERROR "non-integer|truncated|must be integer"
|
|
|
|
_ = 1. << (1 << s) // ERROR "non-integer|shift of type float64|must be integer"
|
|
|
|
_ = 1. << (1. << s) // ERROR "non-integer|shift of type float64|must be integer"
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = 1.1 << (1.1 << s) // ERROR "invalid|non-integer|truncated"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
_ = (1 << s) << (1 << s)
|
|
|
|
_ = (1 << s) << (1. << s)
|
2021-11-27 11:33:59 -07:00
|
|
|
_ = (1 << s) << (1.1 << s) // ERROR "truncated|must be integer"
|
|
|
|
_ = (1. << s) << (1 << s) // ERROR "non-integer|shift of type float64|must be integer"
|
|
|
|
_ = (1. << s) << (1. << s) // ERROR "non-integer|shift of type float64|must be integer"
|
2013-06-26 09:23:52 -06:00
|
|
|
_ = (1.1 << s) << (1.1 << s) // ERROR "invalid|non-integer|truncated"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
var x int
|
|
|
|
x = 1 << (1 << s)
|
|
|
|
x = 1 << (1. << s)
|
2021-11-27 11:33:59 -07:00
|
|
|
x = 1 << (1.1 << s) // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
x = 1. << (1 << s)
|
|
|
|
x = 1. << (1. << s)
|
2021-11-27 11:33:59 -07:00
|
|
|
x = 1.1 << (1.1 << s) // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
x = (1 << s) << (1 << s)
|
|
|
|
x = (1 << s) << (1. << s)
|
2021-11-27 11:33:59 -07:00
|
|
|
x = (1 << s) << (1.1 << s) // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
x = (1. << s) << (1 << s)
|
|
|
|
x = (1. << s) << (1. << s)
|
2021-11-27 11:33:59 -07:00
|
|
|
x = (1.1 << s) << (1.1 << s) // ERROR "truncated|must be integer"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
var y float32
|
2013-06-26 09:23:52 -06:00
|
|
|
y = 1 << (1 << s) // ERROR "non-integer|type float32"
|
|
|
|
y = 1 << (1. << s) // ERROR "non-integer|type float32"
|
|
|
|
y = 1 << (1.1 << s) // ERROR "invalid|truncated|float32"
|
|
|
|
y = 1. << (1 << s) // ERROR "non-integer|type float32"
|
|
|
|
y = 1. << (1. << s) // ERROR "non-integer|type float32"
|
|
|
|
y = 1.1 << (1.1 << s) // ERROR "invalid|truncated|float32"
|
2013-03-21 17:56:59 -06:00
|
|
|
|
|
|
|
var z complex128
|
2013-06-26 09:23:52 -06:00
|
|
|
z = (1 << s) << (1 << s) // ERROR "non-integer|type complex128"
|
|
|
|
z = (1 << s) << (1. << s) // ERROR "non-integer|type complex128"
|
|
|
|
z = (1 << s) << (1.1 << s) // ERROR "invalid|truncated|complex128"
|
2021-11-27 11:33:59 -07:00
|
|
|
z = (1. << s) << (1 << s) // ERROR "non-integer|type complex128|must be integer"
|
|
|
|
z = (1. << s) << (1. << s) // ERROR "non-integer|type complex128|must be integer"
|
2013-06-26 09:23:52 -06:00
|
|
|
z = (1.1 << s) << (1.1 << s) // ERROR "invalid|truncated|complex128"
|
2014-07-20 13:25:24 -06:00
|
|
|
|
|
|
|
_, _, _ = x, y, z
|
2013-03-21 17:56:59 -06:00
|
|
|
}
|