From 5e46c6a10f578333d9ba3f9aa2e4a0d3adb196a4 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 19 Oct 2020 15:24:39 -0700 Subject: [PATCH] [dev.typeparams] cmd/compile/internal/syntax: add Pos method Allows syntax.Pos values to implement interface { Pos() Pos } Preparation step for types2 package. Change-Id: Ib0f4d7695a3d066983567d680fc3b9256a31c31d Reviewed-on: https://go-review.googlesource.com/c/go/+/263622 Trust: Robert Griesemer Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/syntax/pos.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/compile/internal/syntax/pos.go b/src/cmd/compile/internal/syntax/pos.go index c683c7fcfc..99734d42d8 100644 --- a/src/cmd/compile/internal/syntax/pos.go +++ b/src/cmd/compile/internal/syntax/pos.go @@ -26,6 +26,7 @@ func MakePos(base *PosBase, line, col uint) Pos { return Pos{base, sat32(line), // TODO(gri) IsKnown makes an assumption about linebase < 1. // Maybe we should check for Base() != nil instead. +func (pos Pos) Pos() Pos { return pos } func (pos Pos) IsKnown() bool { return pos.line > 0 } func (pos Pos) Base() *PosBase { return pos.base } func (pos Pos) Line() uint { return uint(pos.line) } -- 2.48.1