Last active
September 28, 2016 23:48
-
-
Save DeepSpawn/d88033adac54ccb1fcefa61376af4dc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Parent<T> { | |
public abstract Parent<T> goodMethod(Function<Integer, Parent<T>> f); | |
public abstract <TT extends T> Parent<TT> badMethod(Function<Integer, Parent<TT>> f); | |
private static final class Child<T> extends Parent<T> { | |
T value; | |
@Override | |
public Parent<T> goodMethod(final Function<Integer, Parent<T>> f) { | |
return this; //compile | |
} | |
@Override | |
public <TT extends T> Parent<TT> badMethod(final Function<Integer, Parent<TT>> f) { | |
return this; //does not compile | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment