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: generic type alias useable without instantiation #67683

Closed
griesemer opened this issue May 28, 2024 · 2 comments
Closed

cmd/compile: generic type alias useable without instantiation #67683

griesemer opened this issue May 28, 2024 · 2 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

Compiling this program (with GOEXPERIMENT=aliastypeparams)

package p

type A[P any] func()
type B[P any] = func()
type C[P any] = B[P]

var _ = A(nil) // ERROR "cannot use generic type A without instantiation"
var _ = B(nil)
var _ = C(nil)

reports only one error (for A). There should be an error for each of A, B, and C.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label May 28, 2024
@griesemer griesemer added this to the Go1.23 milestone May 28, 2024
@griesemer griesemer self-assigned this May 28, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 28, 2024
@griesemer
Copy link
Contributor Author

Related to #67547.
cc: @findleyr

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/588855 mentions this issue: go/types, types2: report error when using uninstantiated signature alias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants