You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: if -G=3 fully enabled in compiler, go test cmd/go -test.run TestScript/mod_edit_go fails #45594
For current master, if you enable -G=3 in the compiler by adding 'Flag.G = 3' at the end of ParseFlags in cmd/compile/internal/base/flag.go, then this command fails
go test cmd/go -test.run TestScript/mod_edit_go
with error:
--- FAIL: TestScript (0.01s)
--- FAIL: TestScript/mod_edit_go (0.03s)
script_test.go:254:
# Test support for go mod -edit to set language version. (0.017s)
> env GO111MODULE=on
> ! go build
[stderr]
# m
./alias.go:2:6: type aliases requires go1.9 or later
[exit status 2]
> stderr 'type aliases only supported as of'
FAIL: testdata/script/mod_edit_go.txt:5: no match for `(?m)type aliases only supported as of` found in stderr
So, as we can see, the types2 typechecker is printing 'type aliases requires go1.9 or later', whereas our current noder.go prints 'type aliases only supported as of -lang=go1.9'.
We should probably reconcile these two so that the same test works for both, and we can get through the gotests with -G=3 fully enabled (i.e. using the types2 typechecker) without failing.
Activity
danscales commentedon Apr 15, 2021
@griesemer
gopherbot commentedon Apr 29, 2021
Change https://golang.org/cl/314776 mentions this issue:
cmd/compile/internal/types2: match compiler error for invalid type alias decl