Why does coroutine continuation have the property of generic ~invariance~*contravariance*?
e
ephemient
04/29/2024, 9:17 AM
that is contravariant, not invariant
👍 1
s
streetsofboston
04/29/2024, 12:00 PM
Contravariance opens up the possibility that a type is a subtype of Continuation<T> if its generic type parameter is a supertype of T, adding a bit of typing flexibility while still having type-safety. I think that if it were invariant, then that flexibility just wouldn't be there.