aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Findley <rfindley@google.com>2023-01-11 14:41:03 -0500
committerGopher Robot <gobot@golang.org>2023-01-11 22:29:34 +0000
commit245e95dfabd77f337373bf2d6bb47cd353ad8d74 (patch)
tree051d706f3319c8ee7bd1680505d26c5bde357c82 /test
parent18625d9becc559e65ab5b39aa5d27ae6eb7b00aa (diff)
downloadgo-245e95dfabd77f337373bf2d6bb47cd353ad8d74.tar.xz
go/types, types2: don't look up fields or methods when expecting a type
As we have seen many times, the type checker must be careful to avoid accessing named type information before the type is fully set up. We need a more systematic solution to this problem, but for now avoid one case that causes a crash: checking a selector expression on an incomplete type when a type expression is expected. For golang/go#57522 Change-Id: I7ed31b859cca263276e3a0647d1f1b49670023a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/461577 Run-TryBot: Robert Findley <rfindley@google.com> Auto-Submit: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue18392.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/fixedbugs/issue18392.go b/test/fixedbugs/issue18392.go
index e0640ed2ee..32c39c3a7f 100644
--- a/test/fixedbugs/issue18392.go
+++ b/test/fixedbugs/issue18392.go
@@ -10,5 +10,5 @@ type A interface {
// TODO(mdempsky): This should be an error, but this error is
// nonsense. The error should actually mention that there's a
// type loop.
- Fn(A.Fn) // ERROR "type A has no method Fn|A.Fn undefined"
+ Fn(A.Fn) // ERROR "type A has no method Fn|A.Fn undefined|A.Fn is not a type"
}