We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For
// -gotypesalias=1 package p var x T[B] type T[_ any] struct{} type A T[B] type B = T[A]
types2 produces the trace:
testdata/manual.go:7:6: -- checking type T (white, objPath = ) testdata/manual.go:7:10: . -- type any testdata/manual.go:7:10: . => any (under = any) // *Alias testdata/manual.go:7:15: . -- type struct{} testdata/manual.go:7:15: . => struct{} // *Struct testdata/manual.go:7:6: => type T[_ any] struct{} (black) testdata/manual.go:8:6: -- checking type A (white, objPath = ) testdata/manual.go:8:9: . -- type T[B] testdata/manual.go:8:8: . . -- instantiating type T with [B] testdata/manual.go:8:8: . . . -- type T testdata/manual.go:8:8: . . . => T[_₁ any] (under = struct{}) // *Named testdata/manual.go:8:10: . . . -- type B testdata/manual.go:9:6: . . . . -- checking type B (white, objPath = A) testdata/manual.go:9:11: . . . . . -- type T[A] testdata/manual.go:9:10: . . . . . . -- instantiating type T with [A] testdata/manual.go:9:10: . . . . . . . -- type T testdata/manual.go:9:10: . . . . . . . => T[_₁ any] (under = struct{}) // *Named testdata/manual.go:9:12: . . . . . . . -- type A testdata/manual.go:8:6: . . . . . . . . ## cycle detected: objPath = A->B->A (len = 2) testdata/manual.go:8:6: . . . . . . . . ## cycle contains: 0 values, 1 type definitions testdata/manual.go:8:6: . . . . . . . . => cycle is valid testdata/manual.go:9:12: . . . . . . . => A (under = <nil>) // *Named testdata/manual.go:9:10: . . . . . . => T[A] testdata/manual.go:9:11: . . . . . => T[A] (under = <nil>) // *Named testdata/manual.go:9:6: . . . . => type B = T[A] (black) testdata/manual.go:8:10: . . . => B (under = <nil>) // *Alias testdata/manual.go:8:8: . . => T[B] testdata/manual.go:8:9: . => T[B] (under = <nil>) // *Named testdata/manual.go:8:8: -- Named.expandUnderlying T[B] testdata/manual.go:8:8: => T[B] (tparams = [], under = <nil>) testdata/manual.go:8:6: => type A struct{} (black) testdata/manual.go:5:5: -- checking var x (white, objPath = ) testdata/manual.go:5:8: . -- type T[B] testdata/manual.go:5:7: . . -- instantiating type T with [B] testdata/manual.go:5:7: . . . -- type T testdata/manual.go:5:7: . . . => T[_₁ any] (under = struct{}) // *Named testdata/manual.go:5:9: . . . -- type B testdata/manual.go:5:9: . . . => B (under = <nil>) // *Alias testdata/manual.go:5:7: . . => T[B] testdata/manual.go:5:8: . => T[B] (under = struct{}) // *Named testdata/manual.go:5:5: => var x T[B] (black)
but go/types produces:
testdata/manual.go:5:5: -- checking var x (white, objPath = ) testdata/manual.go:5:7: . -- type T[B] testdata/manual.go:5:7: . . -- instantiating type T with [B] testdata/manual.go:5:7: . . . -- type T testdata/manual.go:7:6: . . . . -- checking -> type T (white, objPath = x) testdata/manual.go:7:8: . . . . . type params = [_₁] testdata/manual.go:7:10: . . . . . -- type any testdata/manual.go:7:10: . . . . . => any (under = any) // *Alias testdata/manual.go:7:15: . . . . . -- type struct{} testdata/manual.go:7:15: . . . . . => struct{} // *Struct testdata/manual.go:7:6: . . . . => -> type T[_ any] struct{} (black) testdata/manual.go:5:7: . . . => T[_₁ any] (under = struct{}) // *Named testdata/manual.go:5:9: . . . -- type B testdata/manual.go:9:6: . . . . -- checking -> type B (white, objPath = x) testdata/manual.go:9:10: . . . . . -- type T[A] testdata/manual.go:9:10: . . . . . . -- instantiating type T with [A] testdata/manual.go:9:10: . . . . . . . -- type T testdata/manual.go:9:10: . . . . . . . => T[_₁ any] (under = struct{}) // *Named testdata/manual.go:9:12: . . . . . . . -- type A testdata/manual.go:8:6: . . . . . . . . -- checking -> type A (white, objPath = x->B) testdata/manual.go:8:8: . . . . . . . . . -- type T[B] testdata/manual.go:8:8: . . . . . . . . . . -- instantiating type T with [B] testdata/manual.go:8:8: . . . . . . . . . . . -- type T testdata/manual.go:8:8: . . . . . . . . . . . => T[_₁ any] (under = struct{}) // *Named testdata/manual.go:8:10: . . . . . . . . . . . -- type B testdata/manual.go:9:6: . . . . . . . . . . . . ## cycle detected: objPath = B->A->B (len = 2) testdata/manual.go:9:6: . . . . . . . . . . . . ## cycle contains: 0 values, 1 type definitions testdata/manual.go:9:6: . . . . . . . . . . . . => cycle is valid testdata/manual.go:8:10: . . . . . . . . . . . => B (under = invalid type) // *Alias testdata/manual.go:8:8: . . . . . . . . . . => invalid type testdata/manual.go:8:8: . . . . . . . . . => invalid type // *Basic testdata/manual.go:8:6: . . . . . . . . => -> type A invalid type (black) testdata/manual.go:9:12: . . . . . . . => A (under = invalid type) // *Named testdata/manual.go:9:10: . . . . . . => T[A] testdata/manual.go:9:10: . . . . . => T[A] (under = <nil>) // *Named testdata/manual.go:9:6: . . . . => -> type B = T[A] (black) testdata/manual.go:5:9: . . . => B (under = <nil>) // *Alias testdata/manual.go:5:7: . . => T[B] testdata/manual.go:5:7: . => T[B] (under = <nil>) // *Named testdata/manual.go:5:5: => var x T[B] (black)
Note the invalid underlying types for A and the different evaluation strategy.
A
This causes at least one of the failures in #66859.
The text was updated successfully, but these errors were encountered:
Looks like this was already fixed in types2 with CL 577616 but not ported.
Sorry, something went wrong.
Change https://go.dev/cl/586236 mentions this issue: go/types: re-enable suppressed gcimporter tests
go/types: re-enable suppressed gcimporter tests
f73dd81
griesemer
No branches or pull requests
For
types2 produces the trace:
but go/types produces:
Note the invalid underlying types for
A
and the different evaluation strategy.This causes at least one of the failures in #66859.
The text was updated successfully, but these errors were encountered: