expressions.h
115 KB
-
compiler: don't add composite literal keys to package bindings · 0581e6ba
Adding composite literal keys to package bindings gets confusing when it is combined with dot imports. The test case showing the resulting compilation failure is https://golang.org/cl/213899. Fix this by adding a new expression type to hold composite literal keys. We shouldn't see it during lowering if it is a struct field name, because Composite_literal_expression::do_traverse skips struct field names. Or, it should, but that didn't quite work with pointer types so it had to be tweaked. This lets us remove the code that recorded whether an Unknown_expression is a composite literal key. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214017 From-SVN: r280056
Ian Lance Taylor committed