[dev.typeparams] cmd/compile/internal/types2: review of initorder.go
[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 <a6752097faebf1f02d80107d77a9be009089afe3@golang.org>
Reviewed-by: Robert Findley <9179eee875d1ee628c37fb47d7e749e855ffd21f@google.com>

golang/go,golang/go,nawawi/go,golang/go,nawawi/go,nawawi/go,cloudflare/go,cloudflare/go,CAFxX/go,golang/go,CAFxX/go,CAFxX/go,CAFxX/go,CAFxX/go,CAFxX/go,golang/go,cloudflare/go,CAFxX/go,nawawi/go,nawawi/go,golang/go,nawawi/go,golang/go,golang/go,nawawi/go,cloudflare/go,cloudflare/go,cloudflare/go,cloudflare/go,cloudflare/go,nawawi/go,CAFxX/go