forked from JavaTX/JavaCompilerCore
new file: ../../AllgemeinTest/Pair.jav
new file: ../../AllgemeinTest/UseWildcardPair.jav modified: ../../../src/test/java/AllgemeinTest.java
This commit is contained in:
parent
2d82dc1ae4
commit
1c31b6d769
26
resources/AllgemeinTest/Pair.jav
Normal file
26
resources/AllgemeinTest/Pair.jav
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import java.util.Vector;
|
||||||
|
import java.lang.Boolean;
|
||||||
|
|
||||||
|
class Pair<U, T> {
|
||||||
|
U a;
|
||||||
|
T b;
|
||||||
|
|
||||||
|
make(x) {
|
||||||
|
var ret = new Pair<>();
|
||||||
|
ret.a = x.elementAt(0);
|
||||||
|
ret.b = x.elementAt(1);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
compare(p) {
|
||||||
|
|
||||||
|
return p.a = p.b;
|
||||||
|
}
|
||||||
|
|
||||||
|
void m(Pair<?, ?> p, List<? extends Eq> b)
|
||||||
|
{
|
||||||
|
//this.compare(p); //1, type incorrect
|
||||||
|
this.compare(this.make(b)); //2, OK
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
12
resources/AllgemeinTest/UseWildcardPair.jav
Normal file
12
resources/AllgemeinTest/UseWildcardPair.jav
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import java.util.Vector;
|
||||||
|
import java.lang.Boolean;
|
||||||
|
|
||||||
|
class UseWildcardPair{
|
||||||
|
|
||||||
|
void m(Pair<?, ?> p, Vector<?> b)
|
||||||
|
{
|
||||||
|
p.compare(p); //1, type incorrect
|
||||||
|
p.compare(p.make(b)); //2, OK
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -51,7 +51,9 @@ public class AllgemeinTest {
|
|||||||
//String className = "VectorConstAdd";
|
//String className = "VectorConstAdd";
|
||||||
//String className = "VectorNotObject";
|
//String className = "VectorNotObject";
|
||||||
//String className = "WildcardCaptureConversionTest";
|
//String className = "WildcardCaptureConversionTest";
|
||||||
String className = "CaptureConversion";
|
//String className = "CaptureConversion";
|
||||||
|
String className = "Pair";
|
||||||
|
//String className = "UseWildcardPair";
|
||||||
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
|
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
|
||||||
path = System.getProperty("user.dir")+"/resources/AllgemeinTest/" + className + ".jav";
|
path = System.getProperty("user.dir")+"/resources/AllgemeinTest/" + className + ".jav";
|
||||||
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";
|
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";
|
||||||
|
Loading…
Reference in New Issue
Block a user