return
}
t0, t1 := a[0].typ, a[1].typ
- assert(isTyped(t0) && isTyped(t1) && (isBoolean(t1) || t1 == universeError))
+ assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError))
if m := check.Types; m != nil {
for {
tv := m[x]
-// Copyright 2023 The Go Authors. All rights reserved.
+// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
return
}
t0, t1 := a[0].typ, a[1].typ
- assert(isTyped(t0) && isTyped(t1) && (isBoolean(t1) || t1 == universeError))
+ assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError))
if m := check.Types; m != nil {
for {
tv := m[x]
-// Copyright 2023 The Go Authors. All rights reserved.
+// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
--- /dev/null
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+func _[T bool](ch chan T) {
+ var _, _ T = <-ch
+}
+
+// offending code snippets from issue
+
+func _[T ~bool](ch <-chan T) {
+ var x, ok T = <-ch
+ println(x, ok)
+}
+
+func _[T ~bool](m map[int]T) {
+ var x, ok T = m[0]
+ println(x, ok)
+}