// check general case by creating custom signature
sig := makeSig(S, S, NewSlice(T)) // []T required for variadic signature
sig.variadic = true
- var xlist []*operand
+ var alist2 []*operand
// convert []operand to []*operand
for i := range alist {
- xlist = append(xlist, &alist[i])
+ alist2 = append(alist2, &alist[i])
}
for i := len(alist); i < nargs; i++ {
var x operand
arg(&x, i)
- xlist = append(xlist, &x)
+ alist2 = append(alist2, &x)
}
- check.arguments(call, sig, nil, xlist, nil) // discard result (we know the result type)
+ check.arguments(call, sig, nil, nil, alist2) // discard result (we know the result type)
// ok to continue even if check.arguments reported errors
x.mode = value
// evaluate arguments
args := check.genericExprList(call.ArgList)
- sig = check.arguments(call, sig, targs, args, xlist)
+ sig = check.arguments(call, sig, targs, xlist, args)
if wasGeneric && sig.TypeParams().Len() == 0 {
// update the recorded type of call.Fun to its instantiated type
}
// xlist is the list of type argument expressions supplied in the source code.
-func (check *Checker) arguments(call *syntax.CallExpr, sig *Signature, targs []Type, args []*operand, xlist []syntax.Expr) (rsig *Signature) {
+func (check *Checker) arguments(call *syntax.CallExpr, sig *Signature, targs []Type, xlist []syntax.Expr, args []*operand) (rsig *Signature) {
rsig = sig
// TODO(gri) try to eliminate this extra verification loop
// check general case by creating custom signature
sig := makeSig(S, S, NewSlice(T)) // []T required for variadic signature
sig.variadic = true
- var xlist []*operand
+ var alist2 []*operand
// convert []operand to []*operand
for i := range alist {
- xlist = append(xlist, &alist[i])
+ alist2 = append(alist2, &alist[i])
}
for i := len(alist); i < nargs; i++ {
var x operand
arg(&x, i)
- xlist = append(xlist, &x)
+ alist2 = append(alist2, &x)
}
- check.arguments(call, sig, nil, xlist, nil) // discard result (we know the result type)
+ check.arguments(call, sig, nil, nil, alist2) // discard result (we know the result type)
// ok to continue even if check.arguments reported errors
x.mode = value
// evaluate arguments
args := check.genericExprList(call.Args)
- sig = check.arguments(call, sig, targs, args, xlist)
+ sig = check.arguments(call, sig, targs, xlist, args)
if wasGeneric && sig.TypeParams().Len() == 0 {
// Update the recorded type of call.Fun to its instantiated type.
}
// xlist is the list of type argument expressions supplied in the source code.
-func (check *Checker) arguments(call *ast.CallExpr, sig *Signature, targs []Type, args []*operand, xlist []ast.Expr) (rsig *Signature) {
+func (check *Checker) arguments(call *ast.CallExpr, sig *Signature, targs []Type, xlist []ast.Expr, args []*operand) (rsig *Signature) {
rsig = sig
// TODO(gri) try to eliminate this extra verification loop