Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/go2go: constraint type inference example from proposal causes panic #41216
I copied and pasted the constraint type inference example from the proposal, and it causes the translator to panic.
@ianlancetaylor I have a suspicion (to be confirmed): In the example, the expression
Need to investigate some more.
@ianlancetaylor 1) Constraint type inference did indeed not record the inferred signature if inference was applied to a partially provided (rather than inferred, from the value arguments) type parameter list. 2) Because sometimes we don't have an ast.CallExpr node, e.g. in this example
In short, this is a bug in
… params are provided The existing code didn't record the results of constraint type inference when it was applied to a partial list of (provided) type parameters. Changed Info.Inferred map to accept *ast.CallExpr and *ast.IndexExpr as keys ("call" may be f(x) or f[T]). Updates #41216. Change-Id: I5da7467d01643bf74fb78f6c6728209cbd4006c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/253258 Run-TryBot: Robert Griesemer <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Robert Griesemer <email@example.com>