Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: if -G=3 fully enabled in compiler, go test cmd/go TestScript/mod_edit_go fails #45594

danscales opened this issue Apr 15, 2021 · 2 comments


Copy link

@danscales danscales commented Apr 15, 2021

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 TestScript/mod_edit_go

with error:

--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/mod_edit_go (0.03s)
            # Test support for go mod -edit to set language version. (0.017s)
            > env GO111MODULE=on
            > ! go build
            # 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.

Copy link

@danscales danscales commented Apr 15, 2021


@griesemer griesemer added this to the Go1.17 milestone Apr 15, 2021
Copy link

@gopherbot gopherbot commented Apr 29, 2021

Change mentions this issue: cmd/compile/internal/types2: match compiler error for invalid type alias decl


@gopherbot gopherbot closed this in 6afa0ae Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants