fix: convert type properly to the correct type

This commit is contained in:
Nicholas Wiersma
2020-07-08 22:55:03 +02:00
committed by GitHub
parent b3766509cc
commit 659913eebe
2 changed files with 17 additions and 1 deletions

View File

@@ -2011,10 +2011,11 @@ func compositeBinStruct(n *node) {
}
} else {
fieldIndex[i] = []int{i}
convertLiteralValue(c.child[1], typ.Field(i).Type)
if c.typ.cat == funcT {
convertLiteralValue(c.child[1], typ.Field(i).Type)
values[i] = genFunctionWrapper(c.child[1])
} else {
convertLiteralValue(c, typ.Field(i).Type)
values[i] = genValue(c)
}
}