]> Cypherpunks repositories - gostls13.git/commit
[dev.unified] cmd/compile/internal/noder: simplify mixed tag/case RTTI wiring
authorMatthew Dempsky <mdempsky@google.com>
Mon, 18 Jul 2022 20:45:57 +0000 (13:45 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 19 Jul 2022 23:31:17 +0000 (23:31 +0000)
commit64cd6faa13e9155e7942f3f51127c1d61a38fcf7
treedfbe9fe1de5510440cb302542149ac16965f96fe
parenta4c5198a3c8befa2f126fd365de4dc09c32b7886
[dev.unified] cmd/compile/internal/noder: simplify mixed tag/case RTTI wiring

The previous CL largely removed the need for worrying about mixed
tag/case comparisons in switch statements by ensuring they're always
converted to a common type, except for one annoying case: switch
statements with an implicit `true` tag, and case values of interface
type (which must be empty interface, because `bool`'s method set is
empty).

It would be simpler to have writer.go desugar the implicit `true`
itself, because we already handle explicit `true` correctly. But the
existing code already works fine, and I don't want to add further
complexity to writer.go until dictionaries and stenciling is done.

Change-Id: Ia8d44c425b1be7fc578cd570d15a7560fe9d2674
Reviewed-on: https://go-review.googlesource.com/c/go/+/418102
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/noder/reader.go