]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: simplify how irgen handles qualified idents
authorMatthew Dempsky <mdempsky@google.com>
Wed, 20 Jan 2021 21:54:53 +0000 (13:54 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 20 Jan 2021 22:50:16 +0000 (22:50 +0000)
commit89ec17be9a28e07f59aaaa9acd1d26f80c55711f
tree1bc6a02c9fced9d860cbb3308bd099969de7a52d
parentfa01ade41e1632dbb8e1b06ff1e6565e8900fb38
[dev.typeparams] cmd/compile: simplify how irgen handles qualified idents

This CL moves qualified identifier handling into expr0 with other
selector expressions, rather than as a completely separate special
case handled up front. This has a few benefits:

1. It's marginally simpler/cleaner.

2. It allows extra checking for imported objects that they have the
same type that types2 thought they had.

3. For imported, untyped constants, we now instead handle them with
the "tv.Value != nil" case. In particular, this ensures that they've
always already been coerced to the appropriate concrete type by
types2.

Change-Id: Ibf44ae6901db36aa5251f70934616e9fcbd1cbc5
Reviewed-on: https://go-review.googlesource.com/c/go/+/285053
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/expr.go