Kotlin: Move tests from test/kotlin to test-kotlin1

Matches test-kotlin2
This commit is contained in:
Ian Lynagh
2023-11-21 15:28:12 +00:00
parent 08383eaea5
commit f48cc1a526
625 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
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();
}
}