File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
src/cmd/compile/internal/noder Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -1298,9 +1298,9 @@ func (g *irgen) dictPass(info *instInfo) {
1298
1298
// Type switch from nonempty interface. We need a *runtime.itab
1299
1299
// for the dynamic type.
1300
1300
ix := - 1
1301
- for i , ic := range info .dictInfo .itabConvs {
1301
+ for j , ic := range info .dictInfo .itabConvs {
1302
1302
if ic == m .List [i ] {
1303
- ix = info .dictInfo .startItabConv + i
1303
+ ix = info .dictInfo .startItabConv + j
1304
1304
break
1305
1305
}
1306
1306
}
Original file line number Diff line number Diff line change
1
+ // run -gcflags=-G=3
2
+
3
+ // Copyright 2021 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
+ func main () {
10
+ check [string ]()
11
+ }
12
+
13
+ func check [T any ]() {
14
+ var result setter [T ]
15
+ switch result .(type ) {
16
+ case fooA [T ]:
17
+ case fooB [T ]:
18
+ }
19
+ }
20
+
21
+ type setter [T any ] interface {
22
+ Set (T )
23
+ }
24
+
25
+ type fooA [T any ] struct {}
26
+
27
+ func (fooA [T ]) Set (T ) {}
28
+
29
+ type fooB [T any ] struct {}
30
+
31
+ func (fooB [T ]) Set (T ) {}
You can’t perform that action at this time.
0 commit comments