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
latest
go env
doens't matter
Defined a 2D type constraint and tried to call a method with it.
type array interface { ~[20]byte | ~[32]byte } type matrix[U array] interface { ~[2]U | ~[3]U } func F[T matrix[U], U array](v T) { fmt.Println(v) }
https://go.dev/play/p/zEAITslJw5Y
The compiler cannot deduce the type of U.
U
I expect both lines to work, the type information is there for the compiler to figure out both T and U.
T
The text was updated successfully, but these errors were encountered:
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Sorry, something went wrong.
Lol, already had a similar issue closed, just that one also has unbounded slices in there vs this one only arrays. Sigh.
No branches or pull requests
Go version
latest
Output of
go env
in your module/workspace:doens't matter
What did you do?
Defined a 2D type constraint and tried to call a method with it.
https://go.dev/play/p/zEAITslJw5Y
What did you see happen?
The compiler cannot deduce the type of
U
.What did you expect to see?
I expect both lines to work, the type information is there for the compiler to figure out both
T
andU
.The text was updated successfully, but these errors were encountered: