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
Alternatively, you need to write (_ Result(T)) or ((Result(T))). The reason is that (Result(T)) is interpreted as (Result (T)), i.e., the result is named Result and is of parenthesized type (T), for backwards-compatibility.
PS Because of how many people run into this, can there be at least one of them open to investigate if the compiler error message can be improved in all does cases? I understand if it isn't possible and maybe go vet can help here?
There were two syntaxes that I came across that did not work. The second seems covered by #39656, but the first seems like a bug, since this fails (but only for closures):
What did you do?
https://go2goplay.golang.org/p/5qj5r_lSwoK
https://go2goplay.golang.org/p/J9UMhLZJZyH
What did you expect to see?
What did you see instead?
and
Did you find a workaround?
In both cases adding names to the parameters fixed things, so it seems like the parser is broken:
https://go2goplay.golang.org/p/5sJXISHuwAb
https://go2goplay.golang.org/p/9TgTCD5SLnZ
The text was updated successfully, but these errors were encountered: