fix: handle function output value assigned to interface var

This commit is contained in:
Marc Vertes
2020-04-25 17:28:04 +02:00
committed by GitHub
parent a6389aca5e
commit 92eebbade2
3 changed files with 31 additions and 7 deletions

View File

@@ -670,7 +670,12 @@ func call(n *node) {
case defineXStmt, assignXStmt:
for i := range rvalues {
c := n.anc.child[i]
if c.ident != "_" {
switch {
case c.ident == "_":
// Skip assigning return value to blank var.
case c.typ.cat == interfaceT:
rvalues[i] = genValueInterfaceValue(c)
default:
rvalues[i] = genValue(c)
}
}