diff --git a/src/test/resources/inferWildcards/TestClassWildcardsParamType.java b/src/test/resources/inferWildcards/TestClassWildcardsParamType.java new file mode 100644 index 00000000..702440d7 --- /dev/null +++ b/src/test/resources/inferWildcards/TestClassWildcardsParamType.java @@ -0,0 +1,23 @@ +import java.util.List; +import java.lang.String; + +public final class TestClassWildcardsParamType { + public final T1 first; + public final T2 second; + + public TestClassWildcardsParamType(T1 first, T2 second) { + this.first = first; + this.second = second; + } + + public static TestClassWildcardsParamType of(T1 first, T2 second) { + return new TestClassWildcardsParamType(first, second); + } + + public static void main(String[] agrs) { + TestClassWildcardsParamType, String> pair = TestClassWildcardsParamType.of(List.class, "hello"); + + //Outout of compiler + //TestClassWildcardsParamType, String> pair = TestClassWildcardsParamType.of(List.class, "hello"); + } +} \ No newline at end of file diff --git a/src/test/resources/inferWildcards/TestClassWildcardsSingle.java b/src/test/resources/inferWildcards/TestClassWildcardsSingle.java index b9af5a46..8b391975 100644 --- a/src/test/resources/inferWildcards/TestClassWildcardsSingle.java +++ b/src/test/resources/inferWildcards/TestClassWildcardsSingle.java @@ -5,9 +5,6 @@ import java.lang.Object; class TestClassWildcardsSingle { - public TestClassWildcards () { - } - /** * Non working method in normal Java * @param input diff --git a/src/test/resources/inferWildcards/TestClassWildcardsSingleLib.java b/src/test/resources/inferWildcards/TestClassWildcardsSingleLib.java new file mode 100644 index 00000000..0cf2c938 --- /dev/null +++ b/src/test/resources/inferWildcards/TestClassWildcardsSingleLib.java @@ -0,0 +1,10 @@ +import java.util.List; + +class TestClassWildcardsLib +{ + + public List merge (List l1, List l2) { + l2.forEach(s -> {if(!l1.contains(s)) l1.add(s);}); + return l2; + } +} \ No newline at end of file