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
Trials.reject currently is typed to yield Unit in Scala and void in Java. This means that it can't be used in a value expression, so it tends to end up either in a guard block or is hoisted right up to a catch clause of a try construct that encloses the entire parameterised test.
It would be nice to make it more like Scala's ??? operator, so it can be used anywhere, safe in the knowledge that it always throw an exception and is thus nominally compatible with any expected type.
Not sure what the equivalent in Java would be - maybe define it as a generic method and hope that type inference will be able to unify at its call sites?
The text was updated successfully, but these errors were encountered:
Trials.reject
currently is typed to yieldUnit
in Scala andvoid
in Java. This means that it can't be used in a value expression, so it tends to end up either in a guard block or is hoisted right up to a catch clause of a try construct that encloses the entire parameterised test.It would be nice to make it more like Scala's
???
operator, so it can be used anywhere, safe in the knowledge that it always throw an exception and is thus nominally compatible with any expected type.Not sure what the equivalent in Java would be - maybe define it as a generic method and hope that type inference will be able to unify at its call sites?
The text was updated successfully, but these errors were encountered: