-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
scala-cli https://raw.githubusercontent.com/kubukoz/demos/scala3-dependent-error/main.scala
//> using scala "3.1.3"
trait Request {
type Out
}
object demo {
def foo(r: Request)(v: r.Out) = ()
val get: Request { type Out = String } = ???
val put: Request { type Out = Unit } = ???
foo(get)(())
}
In the code above, the compilation error you get with Scala 3.1.3 is:
Found: Unit
Required: demo.get.Out
Scala 2.13.8 gives you more information because it dealiases the Out type:
type mismatch;
found : Unit
required: demo.get.Out
(which expands to) String
I think it's a very useful thing to have, so I hope it can be added back.
Metadata
Metadata
Assignees
Labels
No labels