-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not sure what fixed it, but it seems to be good now. [Cherry-picked 230519f]
- Loading branch information
1 parent
9c615de
commit afc643a
Showing
1 changed file
with
24 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,24 @@ | ||
object Repro { | ||
trait Responsive { | ||
type Response | ||
} | ||
|
||
object Responsive { | ||
type Aux[R] = Responsive {type Response = R} | ||
type Response[R] = R match {case Aux[r] => r} | ||
} | ||
|
||
case class StringRequest(name: String) extends Responsive { | ||
type Response = String | ||
} | ||
|
||
def withImplicit[R <: Responsive](request: R)(implicit ct: scala.reflect.ClassTag[Responsive.Response[R]]): Responsive.Response[R] = ??? | ||
|
||
def withFunction[R <: Responsive](request: R)(call: R => Responsive.Response[R]): Responsive.Response[R] = ??? | ||
|
||
def stringWithFunction(req: StringRequest): String = withFunction(req)(_.getClass.getSimpleName) | ||
|
||
def stringWithImplicit(req: StringRequest): String = withImplicit(req) | ||
|
||
def main(args: Array[String]): Unit = {} | ||
} |