case ir.OCALLFUNC, ir.OCALLMETH, ir.OCALLINTER:
call := call.(*ir.CallExpr)
- typecheck.FixVariadicCall(call)
- typecheck.FixMethodCall(call)
+ typecheck.AssertFixedCall(call)
// Pick out the function callee, if statically known.
//
call.Args = args
}
+func AssertFixedCall(call *ir.CallExpr) {
+ if call.X.Type().IsVariadic() && !call.IsDDD {
+ base.FatalfAt(call.Pos(), "missed FixVariadicCall")
+ }
+ if call.Op() == ir.OCALLMETH {
+ base.FatalfAt(call.Pos(), "missed FixMethodCall")
+ }
+}
+
// ClosureType returns the struct type used to hold all the information
// needed in the closure for clo (clo must be a OCLOSURE node).
// The address of a variable of the returned type can be cast to a func.
}
typecheckaste(ir.OCALL, n.X, n.IsDDD, t.Params(), n.Args, func() string { return fmt.Sprintf("argument to %v", n.X) })
+ FixVariadicCall(n)
FixMethodCall(n)
if t.NumResults() == 0 {
return n
}
n := nn.(*ir.CallExpr)
- typecheck.FixVariadicCall(n)
+ typecheck.AssertFixedCall(n)
if isFuncPCIntrinsic(n) && isIfaceOfFunc(n.Args[0]) {
// For internal/abi.FuncPCABIxxx(fn), if fn is a defined function,