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
sample.gop
utils.go
package main func ListMap[T any](ar []T, fn func(v T) T) { for i, v := range ar { ar[i] = fn(v) } }
num := [1,2,3,4,5] ListMap[int](num, x => x * x) // build pass ListMap(num, x => x) // build error println num
build pass
sample.gop:4:13: cannot use x => x (type func(x T) T) as type func(v int) int in argument to ListMap(num,x => x)
main version
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The following program
sample.gop
triggers an unexpected resultutils.go
sample.gop
Expected result
build pass
Got
sample.gop:4:13: cannot use x => x (type func(x T) T) as type func(v int) int in argument to ListMap(num,x => x)
Gop Version
main version
Additional Notes
No response
The text was updated successfully, but these errors were encountered: