mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Revert "Merge pull request #160 from github/smowton/feature/type-substitution-prototypes"
This reverts commit 1dd83a3f0fab407fe94a09fc517c516ed24b1d0c, reversing changes made to 22aebf8128bfe20bb89e5ecc11e0e8cdd65bf317.
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
class Generic2<T> {
|
||||
|
||||
public Generic2(T init) { stored = init; }
|
||||
|
||||
private T stored;
|
||||
|
||||
T identity2(T param) { return identity(param); }
|
||||
T identity(T param) { return param; }
|
||||
T getter() { return stored; }
|
||||
void setter(T param) { stored = param; }
|
||||
|
||||
}
|
||||
|
||||
public class Test {
|
||||
|
||||
public static void user() {
|
||||
|
||||
Generic2<String> invariant = new Generic2<String>("hello world");
|
||||
invariant.identity("hello world");
|
||||
invariant.identity2("hello world");
|
||||
|
||||
Generic2<? extends String> projectedOut = invariant;
|
||||
projectedOut.getter();
|
||||
|
||||
Generic2<? super String> projectedIn = invariant;
|
||||
projectedIn.setter("hi planet");
|
||||
projectedIn.getter();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user