Skip to content

Commit c931257

Browse files
committed
Add regresion test for #21576
1 parent 4e27694 commit c931257

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/run/i21576.check

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public SubFlow(SubFlowDef<Flow1<In>>,SubFlowDef<Flow2<java.lang.Object>>)
2+
public SubFlowDef<Flow1<In>> SubFlow.delegate1()
3+
public SubFlowDef<Flow2<java.lang.Object>> SubFlow.delegate2()

tests/run/i21576.scala

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import scala.annotation.unchecked.uncheckedVariance
2+
3+
trait SubFlowDef[+F[+_]]
4+
final class Flow1[-In]{
5+
type Repr[+O] = Flow1[In @uncheckedVariance]
6+
}
7+
final class Flow2[+Out]{
8+
type Repr[+O] = Flow2[O]
9+
}
10+
class SubFlow[In, Out](
11+
val delegate1: SubFlowDef[Flow1[In]#Repr],
12+
val delegate2: SubFlowDef[Flow2[Out]#Repr]
13+
)
14+
15+
object Test {
16+
def main(args: Array[String]): Unit = {
17+
classOf[SubFlow[?, ?]]
18+
.getConstructors()
19+
.map(_.toGenericString())
20+
.sorted
21+
.foreach(println)
22+
23+
classOf[SubFlow[?, ?]]
24+
.getMethods()
25+
.filter(_.getName().startsWith("delegate"))
26+
.map(_.toGenericString())
27+
.sorted
28+
.foreach(println)
29+
}
30+
}

0 commit comments

Comments
 (0)