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
objectExampleextendsApp {
traitZSink[-R, +E, +A0, -A, +B] {
defflatMap[R1<:R, E1>:E, A00>:A0, A1<:A, C](
f: B=>ZSink[R1, E1, A00, A1, C]
)(implicitev: A00=:=A1, e2: A1=:=A00):ZSink[R1, E1, A00, A1, C] =???
}
objectZSink {
defidentity[A]:ZSink[Any, Unit, Nothing, A, A] =???defsucceed[A, B](b: B):ZSink[Any, Nothing, A, A, B] =???
}
// cannot prove that Int =:= NothingZSink.identity[Int].flatMap(n =>ZSink.succeed[Int, String](n.toString))
}
expectation
I would have expected this to compile as it does on Scala 2. It appears that the issue is with the implicit evidence parameters in flatMap, since if I remove them the code compiles. In the example, succeed[Int, String] should fix both A00 and A1 to Int so I would have thought it would be straightforward to prove that A00 =:= A1 and vice versa.
Not sure if this is related to the other issues we have observed with contravariant types since one of these type parameters is contravariant. So sorry if this is redundant. We're kind of seeing the symptoms but not sure about the root causes. Thanks again for all your hard work and responsiveness and congratulations on the feature freeze!
The text was updated successfully, but these errors were encountered:
minimized code
expectation
I would have expected this to compile as it does on Scala 2. It appears that the issue is with the implicit evidence parameters in
flatMap
, since if I remove them the code compiles. In the example,succeed[Int, String]
should fix bothA00
andA1
toInt
so I would have thought it would be straightforward to prove thatA00 =:= A1
and vice versa.Not sure if this is related to the other issues we have observed with contravariant types since one of these type parameters is contravariant. So sorry if this is redundant. We're kind of seeing the symptoms but not sure about the root causes. Thanks again for all your hard work and responsiveness and congratulations on the feature freeze!
The text was updated successfully, but these errors were encountered: