Closed shalomhalbert closed 2 years ago
This is an issue in your example.
val actual: Either<Throwable, Int> = IllegalArgumentException().left()
actual.shouldBeLeft()
actual.mapLeft { it } // it is properly resolved to Throwable
Do you have another example or repo I can check out?
Apologies, this was caused by me referencing 1.0.1 instead of 1.1.1, which has a different contract.
No apologies needed 😄 @shalbert94
shouldBeLeft()
'scontract
appears to mess up typing. In the example below,it
inactual.mapLeft { it }
should be aThrowable
, but becauseactual.shouldBeLeft()
is called first,it
is of typeAny?
. This appears to be caused byshouldBeLeft()
's contractExample: