Skip to content

Commit

Permalink
Add regresion test for scala#21576
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Sep 18, 2024
1 parent 4e27694 commit 1b9d12c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/run/i21576.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public SubFlow(SubFlowDef<Flow1<In>>,SubFlowDef<Flow2<java.lang.Object>>)
public SubFlowDef<Flow1<In>> SubFlow.delegate1()
public SubFlowDef<Flow2<java.lang.Object>> SubFlow.delegate2()
31 changes: 31 additions & 0 deletions tests/run/i21576.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// scalajs: --skip
import scala.annotation.unchecked.uncheckedVariance

trait SubFlowDef[+F[+_]]
final class Flow1[-In]{
type Repr[+O] = Flow1[In @uncheckedVariance]
}
final class Flow2[+Out]{
type Repr[+O] = Flow2[O]
}
class SubFlow[In, Out](
val delegate1: SubFlowDef[Flow1[In]#Repr],
val delegate2: SubFlowDef[Flow2[Out]#Repr]
)

object Test {
def main(args: Array[String]): Unit = {
classOf[SubFlow[?, ?]]
.getConstructors()
.map(_.toGenericString())
.sorted
.foreach(println)

classOf[SubFlow[?, ?]]
.getMethods()
.filter(_.getName().startsWith("delegate"))
.map(_.toGenericString())
.sorted
.foreach(println)
}
}

0 comments on commit 1b9d12c

Please sign in to comment.