File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
src/cmd/compile/internal/noder Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1357,6 +1357,9 @@ func (g *genInst) dictPass(info *instInfo) {
13571357 }
13581358 case ir .ODOTTYPE , ir .ODOTTYPE2 :
13591359 dt := m .(* ir.TypeAssertExpr )
1360+ if dt .Type ().IsEmptyInterface () || (dt .Type ().IsInterface () && ! dt .Type ().HasShape ()) {
1361+ break
1362+ }
13601363 if ! dt .Type ().HasShape () && ! (dt .X .Type ().HasShape () && ! dt .X .Type ().IsEmptyInterface ()) {
13611364 break
13621365 }
Original file line number Diff line number Diff line change 1+ // compile
2+
3+ // Copyright 2022 The Go Authors. All rights reserved.
4+ // Use of this source code is governed by a BSD-style
5+ // license that can be found in the LICENSE file.
6+
7+ package main
8+
9+ type Foo struct {}
10+
11+ func (Foo ) Blanker () {}
12+
13+ type Bar [T any ] interface {
14+ Blanker ()
15+ }
16+
17+ type Baz interface {
18+ Some ()
19+ }
20+
21+ func check [T comparable ](p Bar [T ]) {
22+ _ , _ = p .(any )
23+ _ , _ = p .(Baz )
24+ }
25+
26+ func main () {
27+ check [int ](Foo {})
28+ }
You can’t perform that action at this time.
0 commit comments