return nn
}
-// l is an lv and rt is the type of an rv
-// return 1 if this implies a function call
-// evaluating the lv or a function call
-// in the conversion of the types
+// fncall reports whether assigning an rvalue of type rt to an lvalue l might involve a function call.
func fncall(l *Node, rt *types.Type) bool {
if l.HasCall() || l.Op == OINDEXMAP {
return true
if eqtype(l.Type, rt) {
return false
}
+ // There might be a conversion required, which might involve a runtime call.
return true
}
}
r := nr.Field(i)
- // any lv that causes a fn call must be
- // deferred until all the return arguments
- // have been pulled from the output arguments
+ // Any assignment to an lvalue that might cause a function call must be
+ // deferred until all the returned values have been read.
if fncall(l, r.Type) {
tmp := temp(r.Type)
tmp = typecheck(tmp, Erv)