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
/** * Returns a curried version of this function. * * @return a curried function equivalent to this. */defaultFunction1<T1, R> curried() {
returnthis;
}
should probably rather be
/** * Returns a curried version of this function. * * @return a curried function equivalent to this. */defaultFunction1<T1, ? extendsR> curried() {
returnthis;
}
because
/** * Applies this function to one argument and returns the result. * * @param t1 argument 1 * @return the result of function application * */Rapply(T1t1);
is covariant in R by default. Consider the following example:
The override of curried in MyFunctionASub should reflect that its apply method returns ASub but this would require the ? extends R signature in Function1.
What do you think?
The text was updated successfully, but these errors were encountered:
I wonder if
should probably rather be
because
is covariant in
R
by default. Consider the following example:The override of
curried
inMyFunctionASub
should reflect that its apply method returnsASub
but this would require the? extends R
signature inFunction1
.What do you think?
The text was updated successfully, but these errors were encountered: