fix: automatic type conversion when returning untyped value

This commit is contained in:
Marc Vertes
2019-11-19 15:22:05 +01:00
committed by Traefiker Bot
parent 56bec974e1
commit 9f1f31210a
2 changed files with 16 additions and 1 deletions

View File

@@ -1353,7 +1353,11 @@ func _return(n *node) {
case interfaceT:
values[i] = genValueInterface(c)
default:
values[i] = genValue(c)
if c.typ.untyped {
values[i] = genValueAs(c, def.typ.ret[i].TypeOf())
} else {
values[i] = genValue(c)
}
}
}