]> Cypherpunks repositories - gostls13.git/commitdiff
all: add test for issue 20027
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 13 Sep 2024 03:56:48 +0000 (10:56 +0700)
committerGopher Robot <gobot@golang.org>
Fri, 13 Sep 2024 21:21:33 +0000 (21:21 +0000)
Fixes #20027

Change-Id: Ia616d43c0affa7b927ddfb53755072c94ba27917
Reviewed-on: https://go-review.googlesource.com/c/go/+/612618
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
src/cmd/compile/internal/types2/stdlib_test.go
src/go/types/stdlib_test.go
test/fixedbugs/issue20027.go [new file with mode: 0644]

index 108c0629c6aa8bb1ee4820137b34c423601e812e..45c692d511134bb197b82961ad13e8f525828424 100644 (file)
@@ -317,6 +317,7 @@ func TestStdFixed(t *testing.T) {
                "issue16369.go",  // types2 handles this correctly - not an issue
                "issue18459.go",  // types2 doesn't check validity of //go:xxx directives
                "issue18882.go",  // types2 doesn't check validity of //go:xxx directives
+               "issue20027.go",  // types2 does not have constraints on channel element size
                "issue20529.go",  // types2 does not have constraints on stack size
                "issue22200.go",  // types2 does not have constraints on stack size
                "issue22200b.go", // types2 does not have constraints on stack size
index 4dd33a863e8ebf0729e0266ec50a11c04cf872d1..8913c7d2c9602371392b42ebf9b6b2aabe2b3838 100644 (file)
@@ -318,6 +318,7 @@ func TestStdFixed(t *testing.T) {
                "issue16369.go",  // go/types handles this correctly - not an issue
                "issue18459.go",  // go/types doesn't check validity of //go:xxx directives
                "issue18882.go",  // go/types doesn't check validity of //go:xxx directives
+               "issue20027.go",  // go/types does not have constraints on channel element size
                "issue20529.go",  // go/types does not have constraints on stack size
                "issue22200.go",  // go/types does not have constraints on stack size
                "issue22200b.go", // go/types does not have constraints on stack size
diff --git a/test/fixedbugs/issue20027.go b/test/fixedbugs/issue20027.go
new file mode 100644 (file)
index 0000000..e93b359
--- /dev/null
@@ -0,0 +1,13 @@
+// errorcheck
+
+// 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
+
+var _ chan [0x2FFFF]byte         // ERROR "channel element type too large"
+var _ = make(chan [0x2FFFF]byte) // ERROR "channel element type too large"
+
+var c1 chan [0x2FFFF]byte         // ERROR "channel element type too large"
+var c2 = make(chan [0x2FFFF]byte) // ERROR "channel element type too large"