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

go/internal/gcimporter: fix suppressed gotypesalias=1 tests #66859

Open
adonovan opened this issue Apr 16, 2024 · 3 comments
Open

go/internal/gcimporter: fix suppressed gotypesalias=1 tests #66859

adonovan opened this issue Apr 16, 2024 · 3 comments
Assignees
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@adonovan
Copy link
Member

https://go.dev/cl/577715 appears to have broken three "long" tests in go/internal/gcimporter. The quick fix is to disable them; this issue tracks a principled fix.

--- FAIL: TestImportTypeparamTests (69.39s)
--- FAIL: TestImportTypeparamTests/issue50259.go (0.04s)
    gcimporter_test.go:208: imported "A" as "type A struct{}", want "type A invalid type"
--- FAIL: TestImportTypeparamTests/struct.go (0.35s)
    gcimporter_test.go:208: imported "Eint2" as "type Eint2 = E[int]", want "type Eint2 = Eint"
    gcimporter_test.go:208: imported "S2" as "type S2 struct{E[int]; E[bool]; v string}", want "type S2 struct{Eint; Ebool; v string}"
@adonovan adonovan self-assigned this Apr 16, 2024
@gopherbot
Copy link

Change https://go.dev/cl/579415 mentions this issue: go/internal/gcimporter: suppress 3 test cases when gotypesalias=1

@adonovan adonovan added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 16, 2024
gopherbot pushed a commit that referenced this issue Apr 16, 2024
CL 577715 caused these test cases to fail, but this was not
detected by CI because they are "long" tests.

Updates #66859

Change-Id: I84320d9091772540df2ab15f57d93031596bb89b
Reviewed-on: https://go-review.googlesource.com/c/go/+/579415
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
@adonovan adonovan assigned griesemer and unassigned adonovan Apr 16, 2024
@griesemer
Copy link
Contributor

The first error, related to $goroot/test/typeparam/issue50259.go, may possibly be an incorrect type declaration (TBD).

The 2nd and 3rd error, related to $goroot/test/typeparam/struct.go, disappears once the compiler is switched to using Alias types (currently disabled).

@griesemer griesemer added this to the Go1.23 milestone Apr 16, 2024
@griesemer
Copy link
Contributor

Follow-up: the type declaration in $goroot/test/typeparam/issue50259.go looks valid:

var x T[B]

type T[_ any] struct{}
type A T[B]
type B = T[A]

can be written as

var x T[T[A]]

type T[_ any] struct{}
type A T[T[A]]
type B = T[A]

and since A is not used in T these types are ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants