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 -test.run TestScript/mod_edit_go fails #45594

Closed
danscales opened this issue Apr 15, 2021 · 2 comments
Assignees
Milestone

Comments

@danscales
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 -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.

@danscales
Copy link
Author

@danscales danscales commented Apr 15, 2021

Loading

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

@gopherbot gopherbot commented Apr 29, 2021

Change https://golang.org/cl/314776 mentions this issue: cmd/compile/internal/types2: match compiler error for invalid type alias decl

Loading

@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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants