aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/call.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-02-18 09:12:19 -0800
committerRobert Griesemer <gri@golang.org>2021-02-18 20:47:37 +0000
commit8960ce773549007f80e6ebd7a9f6c642308087b9 (patch)
tree53814c7dba1fcce5494473d2c68542ff11664a7b /src/cmd/compile/internal/types2/call.go
parent6f3878b942ab0395ede1bd0644c4e778adfcf908 (diff)
downloadgo-8960ce773549007f80e6ebd7a9f6c642308087b9.tar.gz
go-8960ce773549007f80e6ebd7a9f6c642308087b9.zip
[dev.typeparams] cmd/compile/internal/types2: minor adjustments to match go/types more closely
Change-Id: Ib0144e0dd33e9202037e461a85f72f5db08ebd3a Reviewed-on: https://go-review.googlesource.com/c/go/+/293631 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/call.go')
-rw-r--r--src/cmd/compile/internal/types2/call.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/types2/call.go b/src/cmd/compile/internal/types2/call.go
index 67a76d14fb..72805c453b 100644
--- a/src/cmd/compile/internal/types2/call.go
+++ b/src/cmd/compile/internal/types2/call.go
@@ -17,15 +17,15 @@ import (
// The operand x must be the evaluation of inst.X and its type must be a signature.
func (check *Checker) funcInst(x *operand, inst *syntax.IndexExpr) {
args, ok := check.exprOrTypeList(unpackExpr(inst.Index))
- if ok && len(args) > 0 && args[0].mode != typexpr {
- check.errorf(args[0], "%s is not a type", args[0])
- ok = false
- }
if !ok {
x.mode = invalid
x.expr = inst
return
}
+ if len(args) > 0 && args[0].mode != typexpr {
+ check.errorf(args[0], "%s is not a type", args[0])
+ ok = false
+ }
// check number of type arguments
n := len(args)
@@ -77,7 +77,6 @@ func (check *Checker) funcInst(x *operand, inst *syntax.IndexExpr) {
assert(targ != nil)
}
}
- //check.dump("### inferred targs = %s", targs)
n = len(targs)
inferred = true
}