From 6e98406ac3e654f4df15f662f51eda46434af332 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 27 Oct 2020 11:26:54 -0700 Subject: [PATCH] [dev.typeparams] cmd/compile/internal/types2: review of initorder.go Difference: errorf now accepts any value that implements the poser interface in place of a position argument. All types2 Objects implement poser. type poser interface { Pos() syntax.Pos } f=initorder.go; diff $f ../../../../go/types/$f 5c5 < package types2 --- > package types 154c154 < check.errorf(obj, "initialization cycle for %s", obj.Name()) --- > check.errorf(obj.Pos(), "initialization cycle for %s", obj.Name()) 157c157 < check.errorf(obj, "\t%s refers to", obj.Name()) // secondary error, \t indented --- > check.errorf(obj.Pos(), "\t%s refers to", obj.Name()) // secondary error, \t indented 161c161 < check.errorf(obj, "\t%s", obj.Name()) --- > check.errorf(obj.Pos(), "\t%s", obj.Name()) Change-Id: Id85074fd15a04bb4ff6e8b68a44be6ac5919c71a Reviewed-on: https://go-review.googlesource.com/c/go/+/265678 Trust: Robert Griesemer Reviewed-by: Robert Findley --- src/cmd/compile/internal/types2/initorder.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cmd/compile/internal/types2/initorder.go b/src/cmd/compile/internal/types2/initorder.go index 3bb92d96229..4ef24764a6a 100644 --- a/src/cmd/compile/internal/types2/initorder.go +++ b/src/cmd/compile/internal/types2/initorder.go @@ -1,4 +1,3 @@ -// UNREVIEWED // Copyright 2014 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.