You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- [E007] Type Mismatch Error: leibniz.scala:4:19 ------------------------------
4 | case Refl() => fa
| ^^
| found: F[A](fa)
| required: F[B]
|
one error found
Making it an "extension" method doesn't help, either:
sealedabstractclass===[A, B]
caseclassRefl[A]() extends===[A, A]
object=== {
implicitclassOps[A, B](ev: A===B) {
defsubstitute[F[_]](fa: F[A]):F[B] = ev match {
caseRefl() => fa
}
}
}
-- [E007] Type Mismatch Error: leibniz.scala:9:21 ------------------------------
9 | case Refl() => fa
| ^^
| found: F[A](fa)
| required: F[B]
|
one error found
The text was updated successfully, but these errors were encountered:
First, I'm pleasantly surprised that this compiles with
dotc
(withscalac
, it doesn't):However, if I move the
substitute
method directly onto===
, it doesn't compile anymore:Making it an "extension" method doesn't help, either:
The text was updated successfully, but these errors were encountered: