diff options
author | Robert Griesemer <gri@golang.org> | 2021-03-30 22:07:26 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-04-06 18:59:08 +0000 |
commit | 3a30381b2110f15de85514609965b7cafd90aec0 (patch) | |
tree | 2c298ee9dba09987d66d59373ba759122d589a96 /src/cmd/compile/internal/types2/typexpr.go | |
parent | 93466cc1b697836200e73bb103522324d38e894f (diff) | |
download | go-3a30381b2110f15de85514609965b7cafd90aec0.tar.gz go-3a30381b2110f15de85514609965b7cafd90aec0.zip |
cmd/compile/internal/types2: simplify Checker.funcInst
Now that we use square brackets for instantiations, we
can tell type arguments from ordinary arguments without
"guessing" which permits a simpler implementation.
While at it, also fix a minor position error for type
instantiations (now matching the code for function
instantiations).
Change-Id: I20eca51c5b06259703767b5906e89197d6cd595a
Reviewed-on: https://go-review.googlesource.com/c/go/+/306169
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/typexpr.go')
-rw-r--r-- | src/cmd/compile/internal/types2/typexpr.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/typexpr.go b/src/cmd/compile/internal/types2/typexpr.go index f116461403..ce2fd7797b 100644 --- a/src/cmd/compile/internal/types2/typexpr.go +++ b/src/cmd/compile/internal/types2/typexpr.go @@ -671,7 +671,7 @@ func (check *Checker) instantiatedType(x syntax.Expr, targs []syntax.Expr, def * // determine argument positions (for error reporting) typ.poslist = make([]syntax.Pos, len(targs)) for i, arg := range targs { - typ.poslist[i] = arg.Pos() + typ.poslist[i] = syntax.StartPos(arg) } // make sure we check instantiation works at least once |