Closed slnowak closed 7 years ago
The following test
@Test public void shouldComprehendEitherExpressions() throws Exception { // when final Either<Exception, String> wrapsCappuccino = For .iterable(grind("arabica beans")) .iterable(ground -> heatWater(new Water(25))) .iterable(ground -> water -> brew(ground, water)) .iterable(ground -> water -> espresso -> frothMilk("milk")) .yield(ground -> water -> espresso -> foam -> combine(espresso, foam)) .unwrap(); // then assertThat( wrapsCappuccino.get(), equalTo("cappuccino") ); }
fails with
java.lang.ClassCastException: javaslang.control.Either$Right cannot be cast to javaslang.control.Either$RightProjection
this happens because EitherComprehender explicitely calls either.right() which in turn returns RightProjection.
The following should fix that: https://github.com/aol/cyclops/pull/260
Awesome! Thanks a million for reporting and fixing this!!
This has been released in 8.4.2. - many thanks for the fix!
The following test
fails with
this happens because EitherComprehender explicitely calls either.right() which in turn returns RightProjection.
The following should fix that: https://github.com/aol/cyclops/pull/260