go/src/go
Robert Findley 245e95dfab 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>
2023-01-11 22:29:34 +00:00
..
ast go/ast: record start and end of file in File.File{Start,End} 2022-09-28 20:37:59 +00:00
build os, net/http: avoid escapes from os.DirFS and http.Dir on Windows 2022-12-06 23:50:47 +00:00
constant cmd/compile: in compiler errors, print more digits for floats close to an int 2022-10-20 21:52:09 +00:00
doc all: add missing periods in comments 2022-11-18 17:59:44 +00:00
format go/format: skip go/ast's object resolution 2022-04-21 21:07:18 +00:00
importer go: use testenv.Command instead of exec.Command in tests 2022-11-15 20:17:57 +00:00
internal go/internal/gcimporter: simplify unified IR importer 2022-12-07 03:45:50 +00:00
parser go/parser: allow trailing commas in embedded instantiated types 2022-11-17 17:02:15 +00:00
printer all: fix a few function names on comments 2022-11-03 15:17:11 +00:00
scanner go/scanner: use constant name rather than its value (cleanup) 2022-10-21 15:01:19 +00:00
token go/token: fix File.AddLineColumnInfo logic 2022-10-03 13:05:50 +00:00
types go/types, types2: don't look up fields or methods when expecting a type 2023-01-11 22:29:34 +00:00