Source file
test/fixedbugs/issue66663.go
1
2
3
4
5
6
7 package p
8
9 type Iterator[A any] func() (bool, A)
10
11 type Range[A any] interface {
12 Blocks() Iterator[Block[A]]
13 }
14
15 type Block[A any] interface {
16 Range[A]
17 }
18
19 type rangeImpl[A any] struct{}
20
21 func (r *rangeImpl[A]) Blocks() Iterator[Block[A]] {
22 return func() (bool, Block[A]) {
23 var a Block[A]
24 return false, a
25 }
26 }
27
28 func NewRange[A any]() Range[A] {
29 return &rangeImpl[A]{}
30 }
31
32 type AddrImpl struct{}
33
34 var _ = NewRange[AddrImpl]()
35
View as plain text