fix: interface call regression from #787

Fix #787 changes how interfaces are set on a struct (compositeSparce). This change however makes calling the interface panic. 

This PR reverts part of the change in #787 and adds a test to ensure it does not break again.
This commit is contained in:
Nicholas Wiersma
2020-08-10 16:32:05 +02:00
committed by GitHub
parent 2ac0c6f70b
commit 88569f5df7
2 changed files with 35 additions and 2 deletions

View File

@@ -2116,8 +2116,6 @@ func doCompositeSparse(n *node, hasType bool) {
switch {
case c1.typ.cat == funcT:
values[field] = genFunctionWrapper(c1)
case c1.typ.cat == interfaceT:
values[field] = genValueInterfaceValue(c1)
case isArray(c1.typ) && c1.typ.val != nil && c1.typ.val.cat == interfaceT:
values[field] = genValueInterfaceArray(c1)
case isRecursiveType(n.typ.field[field].typ, n.typ.field[field].typ.rtype):