diff options
Diffstat (limited to 'libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt')
-rw-r--r-- | libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt b/libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt new file mode 100644 index 00000000000..d6216ae2443 --- /dev/null +++ b/libgo/go/cmd/go/testdata/script/mod_go_version_mixed.txt @@ -0,0 +1,43 @@ +# Test that dependencies can use Go language features newer than the +# Go version specified by the main module. + +env GO111MODULE=on + +go build + +-- go.mod -- +module m +go 1.12 +require ( + sub.1 v1.0.0 +) +replace ( + sub.1 => ./sub +) + +-- x.go -- +package x + +import "sub.1" + +func F() { sub.F(0, 0) } + +var A sub.Alias +var D sub.Defined + +-- sub/go.mod -- +module m +go 1.14 + +-- sub/sub.go -- +package sub + +// signed shift counts added in Go 1.13 +func F(l, r int) int { return l << r } + +type m1 interface { M() } +type m2 interface { M() } + +// overlapping interfaces added in Go 1.14 +type Alias = interface { m1; m2; M() } +type Defined interface { m1; m2; M() } |