]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix CONVIFACE case converting interface to empty interface
authorDan Scales <danscales@google.com>
Fri, 13 Aug 2021 00:08:49 +0000 (17:08 -0700)
committerDan Scales <danscales@google.com>
Tue, 17 Aug 2021 13:23:13 +0000 (13:23 +0000)
commitb7b790a71a86678f036b7d30a892c5f792c5092f
tree6289c12416efbbddd25016fff4c1ca3c08c1c7f0
parenta304273d74b95c835ee08b641a17ce6bc591ddd3
cmd/compile: fix CONVIFACE case converting interface to empty interface

We need an extra case in convertToDictionary. In the case of an operand
which is an interface and converting to an empty interface, we don't
want to get the run-time type from the dictionary (which would be the
run-time type of the interface). We want to do a type-assert to the
empty interface.

Change-Id: I414247210168153151272fab198bfe82ad7b1567
Reviewed-on: https://go-review.googlesource.com/c/go/+/342009
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
src/cmd/compile/internal/noder/stencil.go
test/typeparam/issue47272.go [new file with mode: 0644]
test/typeparam/issue47272.out [new file with mode: 0644]