File tree Expand file tree Collapse file tree 4 files changed +26
-4
lines changed
cmd/compile/internal/types2 Expand file tree Collapse file tree 4 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -739,8 +739,6 @@ func (w *cycleFinder) typ(typ Type) {
739
739
// in signatures where they are handled explicitly.
740
740
741
741
case * Signature :
742
- // There are no "method types" so we should never see a recv.
743
- assert (t .recv == nil )
744
742
if t .params != nil {
745
743
w .varList (t .params .vars )
746
744
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2022 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package p
6
+
7
+ func f[P interface{ m(R) }, R any]() {}
8
+
9
+ type T = interface { m(int) }
10
+
11
+ func _() {
12
+ _ = f[ /* ERROR cannot infer R */ T] // don't crash in type inference
13
+ }
Original file line number Diff line number Diff line change @@ -738,8 +738,6 @@ func (w *cycleFinder) typ(typ Type) {
738
738
// in signatures where they are handled explicitly.
739
739
740
740
case * Signature :
741
- // There are no "method types" so we should never see a recv.
742
- assert (t .recv == nil )
743
741
if t .params != nil {
744
742
w .varList (t .params .vars )
745
743
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2022 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package p
6
+
7
+ func f[P interface{ m(R) }, R any]() {}
8
+
9
+ type T = interface { m(int) }
10
+
11
+ func _() {
12
+ _ = f /* ERROR cannot infer R */ [T] // don't crash in type inference
13
+ }
You can’t perform that action at this time.
0 commit comments