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/types, types2: cannot handle partially instantiated generic function argument #59958

Closed
griesemer opened this issue May 3, 2023 · 1 comment
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

package p

func f(func(int) string) {}

func g[P, Q any](P) Q { var q Q; return q }

func _() {
	f(g)      // ok
	f(g[int]) // ERROR: cannot infer Q

	var _ func(int) string = g      // ok
	var _ func(int) string = g[int] // ok
}

The type-checker currently cannot handle a partially instantiated generic function argument.
Would be good to fix for 1.21 but not a release blocker.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label May 3, 2023
@griesemer griesemer added this to the Go1.21 milestone May 3, 2023
@griesemer griesemer self-assigned this May 3, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/494116 mentions this issue: go/types, types2: permit partially instantiated functions as function arguments

@golang golang locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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