Skip to content

Commit cee67be

Browse files
committed
simple: limit generic loop copy test to Go 1.20 and newer
In Go before 1.20, the compiler (but not go/types) rejects generic type declarations inside functions. Our tests didn't fail, however, because the version of Go 1.19 we were testing with had a bug that hid the compiler error from go/packages, and we actually checked the file successfully. Fixing that bug in Go (in c045822e4d7491271c91359a4ff7f333ca5d1ea9) broke the test.
1 parent 8e32e9b commit cee67be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simple/testdata/src/example.com/CheckLoopCopy/copy_generics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build go1.18
1+
//go:build go1.20
22

33
package pkg
44

0 commit comments

Comments
 (0)