Skip to content

go/types, types2: type inference fails when passing the same generic function twice #59956

Closed
@griesemer

Description

@griesemer
package p

func f(func(int), func(string)) {}

func g[P any](P) {}

func _() {
	f(g, g)
}

produces

x.go:8:7: type func[P any](P) of g does not match func(string)

Analysis (by @findleyr): we need to rename g's type parameters to avoid conflicts.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions