Skip to content

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

Closed

Description

@danscales

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

  1. danscales commented on Apr 15, 2021

    @danscales
    ContributorAuthor
  2. added this to the Go1.17 milestone on Apr 15, 2021
  3. gopherbot commented on Apr 29, 2021

    @gopherbot
    Contributor

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

  4. locked and limited conversation to collaborators on Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions