This addresses a situation where Named.fromRHS is nil which
is causing validType to panic when the debug flag is set.
Change-Id: Ie1af3f4d412efc2ce2ee7707af5375ed130a1f2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/393436
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
case *Named:
// Don't report a 2nd error if we already know the type is invalid
// (e.g., if a cycle was detected earlier, via under).
- if t.underlying == Typ[Invalid] {
+ // Note: ensure that t.orig is fully resolved by calling Underlying().
+ if t.Underlying() == Typ[Invalid] {
check.infoMap[t] = invalid
return invalid
}
case *Named:
// Don't report a 2nd error if we already know the type is invalid
- // (e.g., if a cycle was detected earlier, via under).
- if t.underlying == Typ[Invalid] {
+ // Note: ensure that t.orig is fully resolved by calling Underlying().
+ if t.Underlying() == Typ[Invalid] {
check.infoMap[t] = invalid
return invalid
}