Skip to content

Commit

Permalink
Fix #19633: Add regression test.
Browse files Browse the repository at this point in the history
Not sure what fixed it, but it seems to be good now.

[Cherry-picked 230519f]
  • Loading branch information
sjrd authored and WojciechMazur committed Jul 4, 2024
1 parent 9c615de commit afc643a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/pos/i19633.scala
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 = {}
}

0 comments on commit afc643a

Please sign in to comment.