aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/typexpr.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-03-29 15:15:56 -0700
committerRobert Griesemer <gri@golang.org>2021-04-06 18:57:04 +0000
commit93466cc1b697836200e73bb103522324d38e894f (patch)
treeec8e32fa317b4bdf994d192c79b61798e055aa21 /src/cmd/compile/internal/types2/typexpr.go
parentd57189e92b9b4cd6909aefbcee02e9cb6fc05cff (diff)
downloadgo-93466cc1b697836200e73bb103522324d38e894f.tar.gz
go-93466cc1b697836200e73bb103522324d38e894f.zip
cmd/compile/internal/types2: review of pos.go and move into syntax package
This moves the two helper functions startPos and endPos into the syntax package where they belong. Export the functions and adjust dependent code. Change-Id: I8170faeadd7cfa8f53009f81fcffd50ec0fc6a98 Reviewed-on: https://go-review.googlesource.com/c/go/+/305578 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.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/typexpr.go b/src/cmd/compile/internal/types2/typexpr.go
index 7675ce6376..f116461403 100644
--- a/src/cmd/compile/internal/types2/typexpr.go
+++ b/src/cmd/compile/internal/types2/typexpr.go
@@ -131,7 +131,7 @@ func (check *Checker) typ(e syntax.Expr) Type {
// (see ordinaryType).
func (check *Checker) varType(e syntax.Expr) Type {
typ := check.definedType(e, nil)
- check.ordinaryType(startPos(e), typ)
+ check.ordinaryType(syntax.StartPos(e), typ)
return typ
}
@@ -1154,7 +1154,7 @@ func (check *Checker) structType(styp *Struct, e *syntax.StructType) {
// spec: "An embedded type must be specified as a type name T or as a
// pointer to a non-interface type name *T, and T itself may not be a
// pointer type."
- pos := startPos(f.Type)
+ pos := syntax.StartPos(f.Type)
name := embeddedFieldIdent(f.Type)
if name == nil {
check.errorf(pos, "invalid embedded field type %s", f.Type)