cmd/go2go: cannot use x (variable of type X(T)) as X(T) value in assignment #40300
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What did you do?
Tried to compile this program (playground link):
What did you expect to see?
No output, as in this program (playground link):
What did you see instead?
Compiler error:
I tried to minimize the code as much as possible, that's why the original intent is a bit obscured.
I suspect that this is a bug in the prototype - at least I see no reason why it would work with
func(*A(T))
, but not withY(T)
. I thought it might be an issue with recursive generic types (A(T)
mentionsX(T)
mentionsY(T)
mentionsA(T)
), but it should fulfill the requirement of only mentioning the original parameters in the same order. And I wouldn't understand why the error is reported in the assignment and why it vanishes when you delete that. In any case, the error message is, of course, not super helpful :)I'd be interested to know if this is WAI or a limitation of the prototype.
The text was updated successfully, but these errors were encountered: