You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type I interface {
F()
}
func takesI(type T I)(t T) {
_ = T.F
}
func workaround(type T I)(t T) {
_ = (T).F
}
As shown in the full example in the playground link above, calling takesI with T = *SomeType results in compilation failing. Calling workaround is fine, and since the only difference is the manual wrapping of parenthesis this indicates to me that the generated code is just missing grouping of its own which is causing the errors.
What version of Go are you using (
go version
)?The Go 2 dev playground at https://go2goplay.golang.org/
What did you do?
Full example: https://go2goplay.golang.org/p/U43Cljg2tvj
Excerpt:
As shown in the full example in the playground link above, calling
takesI
withT = *SomeType
results in compilation failing. Callingworkaround
is fine, and since the only difference is the manual wrapping of parenthesis this indicates to me that the generated code is just missing grouping of its own which is causing the errors.What did you see instead?
Error messages during compilation:
The text was updated successfully, but these errors were encountered: