-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)typer
Milestone
Description
// if using Scala 2.13.0 then a compile error results in marked line below
// ("found Step[B with A]; required Step[A]")
// if using Dotty then it compiles fine
// after removing the contravariance from Step[E] it compiles also under Scala 2.13
// a Step requires some environment
type Step[-E]
// providing a 'p' allows to transform a step that requires an environment with P into a step that does no more require a P
def provide[E, P](p: P): Step[E with P] => Step[E] = ???
trait A
trait B
val step: Step[A with B] = ???
val b: B = ???
// the compile error occurs here
val s: Step[A] = provide(b)(step)
Metadata
Metadata
Assignees
Labels
fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)typer