From 245e95dfabd77f337373bf2d6bb47cd353ad8d74 Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Wed, 11 Jan 2023 14:41:03 -0500 Subject: 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 Auto-Submit: Robert Findley TryBot-Result: Gopher Robot Reviewed-by: Robert Griesemer --- test/fixedbugs/issue18392.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') 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" } -- cgit v1.3