fix: correct assign from function returning an interface value (#625)

This commit is contained in:
Marc Vertes
2020-05-05 13:54:36 +02:00
committed by GitHub
parent 7eac6955b3
commit 7fab75fbe4
2 changed files with 24 additions and 1 deletions

View File

@@ -678,7 +678,7 @@ func call(n *node) {
switch {
case c.ident == "_":
// Skip assigning return value to blank var.
case c.typ.cat == interfaceT:
case c.typ.cat == interfaceT && rtypes[i].cat != interfaceT:
rvalues[i] = genValueInterfaceValue(c)
default:
rvalues[i] = genValue(c)