x/tools/go/ssa: wrapper function for embedded type has invalid variadic parameter #27453
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version:
go1.11 linux/amd64
Package "x/tools/go/ssa" version: master (golang/tools@7ca1327)
See this code (play):
It produces the following SSA (shortened). I've also printed the actual parameters just before printing the SSA, for debugging.
As you can see,
(*examples/varargbug.Foo).Call
somehow has type[][]interface{}
for the variadic arguments, which I believe is incorrect. It should be[]interface{}
, as that's what is used in other places for variadic arguments. The result is that when the wrapper calls the underlying function, there is a type mismatch.One place in the standard library where this happens is in "syscall/js". The
Error
type embeds theValue
type so the SSA translation creates a wrapper function called(*syscall/js.Error).Call()
, leading to this issue.The text was updated successfully, but these errors were encountered: