-// REVIEW INCOMPLETE
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
return statement
case typexpr:
- // conversion or type instantiation
+ // conversion
T := x.typ
x.mode = invalid
- if isGeneric(T) {
- // type instantiation
- x.typ = check.typ(call)
- if x.typ != Typ[Invalid] {
- x.mode = typexpr
- }
- return expression
- }
-
- // conversion
switch n := len(call.Args); n {
case 0:
check.errorf(inNode(call, call.Rparen), _WrongArgCount, "missing argument in conversion to %s", T)
// exprOrTypeList returns a list of operands and reports an error if the
// list contains a mix of values and types (ignoring invalid operands).
+// TODO(rFindley) Now we can split this into exprList and typeList.
func (check *Checker) exprOrTypeList(elist []ast.Expr) (xlist []*operand, ok bool) {
ok = true
}
// check arguments
- // TODO(gri) Possible optimization (may be tricky): We could avoid
- // checking arguments from which we inferred type arguments.
for i, a := range args {
check.assignment(a, sigParams.vars[i].typ, check.sprintf("argument to %s", call.Fun))
}