aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/typexpr.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-03-09 17:14:15 -0800
committerRobert Griesemer <gri@golang.org>2021-03-10 01:46:25 +0000
commit41245ab28390fed22ba03ee87c0e3db97b16c73b (patch)
tree0b71f410545740e51e41f494517ff304141955ac /src/cmd/compile/internal/types2/typexpr.go
parentacd7cb5887f486558fbcd517ed636a96447d695d (diff)
downloadgo-41245ab28390fed22ba03ee87c0e3db97b16c73b.tar.gz
go-41245ab28390fed22ba03ee87c0e3db97b16c73b.zip
cmd/compile/internal/types2: remove concept of finals
This is a 1:1 port of the respective change in go/types in https://golang.org/cl/299590. Change-Id: I65ad723f2e21e3d95fc0b94665e0121e31871a48 Reviewed-on: https://go-review.googlesource.com/c/go/+/300250 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@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.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/types2/typexpr.go b/src/cmd/compile/internal/types2/typexpr.go
index 177fcf4215..14bc91785e 100644
--- a/src/cmd/compile/internal/types2/typexpr.go
+++ b/src/cmd/compile/internal/types2/typexpr.go
@@ -141,7 +141,7 @@ func (check *Checker) ordinaryType(pos syntax.Pos, typ Type) {
// We don't want to call under() (via Interface) or complete interfaces while we
// are in the middle of type-checking parameter declarations that might belong to
// interface methods. Delay this check to the end of type-checking.
- check.atEnd(func() {
+ check.later(func() {
if t := asInterface(typ); t != nil {
check.completeInterface(pos, t) // TODO(gri) is this the correct position?
if t.allTypes != nil {
@@ -574,7 +574,7 @@ func (check *Checker) typInternal(e0 syntax.Expr, def *Named) (T Type) {
//
// Delay this check because it requires fully setup types;
// it is safe to continue in any case (was issue 6667).
- check.atEnd(func() {
+ check.later(func() {
if !Comparable(typ.key) {
var why string
if asTypeParam(typ.key) != nil {
@@ -676,7 +676,7 @@ func (check *Checker) instantiatedType(x syntax.Expr, targs []syntax.Expr, def *
// make sure we check instantiation works at least once
// and that the resulting type is valid
- check.atEnd(func() {
+ check.later(func() {
t := typ.expand()
check.validType(t, nil)
})
@@ -954,7 +954,7 @@ func (check *Checker) completeInterface(pos syntax.Pos, ityp *Interface) {
// If we're pre-go1.14 (overlapping embeddings are not permitted), report that
// error here as well (even though we could do it eagerly) because it's the same
// error message.
- check.atEnd(func() {
+ check.later(func() {
if !check.allowVersion(m.pkg, 1, 14) || !check.identical(m.typ, other.Type()) {
var err error_
err.errorf(pos, "duplicate method %s", m.name)
@@ -1170,7 +1170,7 @@ func (check *Checker) structType(styp *Struct, e *syntax.StructType) {
// (via under(t)) a possibly incomplete type.
embeddedTyp := typ // for closure below
embeddedPos := pos
- check.atEnd(func() {
+ check.later(func() {
t, isPtr := deref(embeddedTyp)
switch t := optype(t).(type) {
case *Basic:
@@ -1230,7 +1230,7 @@ func (check *Checker) collectTypeConstraints(pos syntax.Pos, types []syntax.Expr
// interfaces, which may not be complete yet. It's ok to do this check at the
// end because it's not a requirement for correctness of the code.
// Note: This is a quadratic algorithm, but type lists tend to be short.
- check.atEnd(func() {
+ check.later(func() {
for i, t := range list {
if t := asInterface(t); t != nil {
check.completeInterface(types[i].Pos(), t)