]> Cypherpunks repositories - gostls13.git/commit
go/types: better cycle reporting for some cyclic composite literals
authorRobert Griesemer <gri@golang.org>
Wed, 9 May 2018 01:01:16 +0000 (18:01 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 31 May 2018 18:22:15 +0000 (18:22 +0000)
commit6dbaf0352a911f2f4c835dcfbf32aeb38f0b4462
tree6e83050152fdb9127006724e39fdefed67760d85
parent462c182ce7d6ee16af9731e7d14da2cb9be6a91a
go/types: better cycle reporting for some cyclic composite literals

To evaluate the type of composite literals, the type checker called
Checker.typ which breaks cycles. As a result, certain cycles were
not reported with actual cycle reporting, but caught due to other
uninitialized fields (with less nice error message).

The change now calls Checker.typExpr at the relevant call site.

For #18643.

Change-Id: Iecb3f0e1afb4585b85553b6c581212f52ac3a1c4
Reviewed-on: https://go-review.googlesource.com/115456
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/builtins.go
src/go/types/expr.go
src/go/types/testdata/cycles.src
src/go/types/typexpr.go