]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: bail early if we want a type but don't have one
authorRobert Griesemer <gri@golang.org>
Tue, 30 Jan 2024 00:34:16 +0000 (16:34 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 5 Feb 2024 18:13:11 +0000 (18:13 +0000)
commit2c6f24c825aa91632a286ac34603d970f7a9f2f5
treeae1f10cd7e406dd74ac77d11c3265e550089abac
parent10a65649a3b2e34ffe8e4202bfa3df851cea0fb4
go/types, types2: bail early if we want a type but don't have one

If we do know whether we need a type or not, make use of the
information when we know that we don't have a type and bail out.

Fixes the issue at hand and also improves some other error messages
which now report that we don't have a type instead of reporting a cycle.

For #65344.

Change-Id: I11182efd452c485d89e6c09ead8a647ea05d7318
Reviewed-on: https://go-review.googlesource.com/c/go/+/559335
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/types2/typexpr.go
src/go/types/typexpr.go
src/internal/types/testdata/check/cycles5.go
src/internal/types/testdata/check/cycles5a.go
src/internal/types/testdata/check/decls1.go
src/internal/types/testdata/check/issues0.go
src/internal/types/testdata/fixedbugs/issue39634.go
src/internal/types/testdata/fixedbugs/issue65344.go [new file with mode: 0644]