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: for -lang=go1.20, type inference doesn't work for partially instantiated functions #60346

Closed
griesemer opened this issue May 22, 2023 · 1 comment

Comments

@griesemer
Copy link
Contributor

griesemer commented May 22, 2023

// -lang=go1.20

package p

func F[P any, Q *P](p P) {}

var _ = F[int]

func G[R any](func(R)) {}

func _() {
	G(F[int]) // ERROR implicitly instantiated function as argument requires go1.21 or later
}

This used to work.

(Example courtesy of @findleyr.)

@griesemer griesemer added this to the Go1.21 milestone May 22, 2023
@griesemer griesemer self-assigned this May 22, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/496917 mentions this issue: go/types, types2: keep inferring type arguments from constraints for -lang < go1.21

@golang golang locked and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants