forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e27694
commit 1b9d12c
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |