forked from JavaTX/JavaCompilerCore
Compare commits
121
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb01e78123 | ||
|
|
e1e1f3eafc | ||
|
|
9c1e016bb1 | ||
|
|
eaeb3c4106 | ||
|
|
1fb431ab36 | ||
|
|
124313cb16 | ||
|
|
d48b888075 | ||
|
|
f5aa90bdbd | ||
|
|
4bcb91ce2d | ||
|
|
97a1bcbbe1 | ||
|
|
f32b1ee5b2 | ||
|
|
711aa70d48 | ||
|
|
168a499811 | ||
|
|
d52fbeb1ae | ||
|
|
ce0ef10c8d | ||
|
|
81e19f5315 | ||
|
|
89a791b81e | ||
|
|
2d1caf9ded | ||
|
|
49b0494f36 | ||
|
|
60e2d8177b | ||
|
|
62e7a1c871 | ||
|
|
761dd48fa1 | ||
|
|
4a18a81b33 | ||
|
|
9eb0dd1cf5 | ||
|
|
bb0ee7d517 | ||
|
|
fe2b3accb3 | ||
|
|
78ad7bc003 | ||
|
|
f08744479a | ||
|
|
bf15ff693e | ||
|
|
48199b5d2e | ||
|
|
7556b9f590 | ||
|
|
03b7f12541 | ||
|
|
ecc5dfcef6 | ||
|
|
f33aab9cfb | ||
|
|
3875de7f80 | ||
|
|
69f44c2927 | ||
|
|
26398a692f | ||
|
|
e13baa8acb | ||
|
|
3c86eecf8b | ||
|
|
63c5cb8390 | ||
|
|
e3edd0410a | ||
|
|
eb5cf1ab33 | ||
|
|
b409175a25 | ||
|
|
a54938cb65 | ||
|
|
30a62a6621 | ||
|
|
dce3ed8051 | ||
|
|
8e5a20e59e | ||
|
|
337ff8b865 | ||
|
|
1d7e755a98 | ||
|
|
67a582b4a2 | ||
|
|
034a398515 | ||
|
|
58a72b0286 | ||
|
|
677d68428d | ||
|
|
d2ef5ccb24 | ||
|
|
66944cf3c1 | ||
|
|
9d9a1f6614 | ||
|
|
0b33948945 | ||
|
|
5e1631439a | ||
|
|
8992260264 | ||
|
|
f8f76e9f7d | ||
|
|
52b7040337 | ||
|
|
4986fd0f31 | ||
|
|
dc8578632c | ||
|
|
9a780127c0 | ||
|
|
0311f5ed77 | ||
|
|
b1b7c23166 | ||
|
|
0ca32ca6a7 | ||
|
|
1ab0f42fd1 | ||
|
|
856d343ed3 | ||
|
|
2c7037708b | ||
|
|
78a898db37 | ||
|
|
aeb4b18069 | ||
|
|
79c82c122a | ||
|
|
27ee00b069 | ||
|
|
af28e033a2 | ||
|
|
761e693984 | ||
|
|
d6c22a60bc | ||
|
|
a8012a3ea6 | ||
|
|
31ee90b3ff | ||
|
|
96d19efa5d | ||
|
|
1919e34eed | ||
|
|
043dda660b | ||
|
|
8c6a614157 | ||
|
|
09cc88062e | ||
|
|
2197e09307 | ||
|
|
d362858184 | ||
|
|
c118c05bb2 | ||
|
|
aa5f79257e | ||
|
|
f282d7a212 | ||
|
|
4c685a9ed9 | ||
|
|
55636436d2 | ||
|
|
5981a9362c | ||
|
|
c38bf658fc | ||
|
|
0e981ce95c | ||
|
|
40d0d6b63e | ||
|
|
a77970b5e7 | ||
|
|
ca327375c8 | ||
|
|
4f4ca50c75 | ||
|
|
1cf23bec90 | ||
|
|
3bdc3b764d | ||
|
|
a13294edf4 | ||
|
|
a85b60b95f | ||
|
|
def76724b5 | ||
|
|
eb5a339f56 | ||
|
|
d6b25bc76e | ||
|
|
c78a148766 | ||
|
|
cb564dc436 | ||
|
|
6d52949215 | ||
|
|
b0bec83900 | ||
|
|
0ee3117d6e | ||
|
|
96142339e0 | ||
|
|
3cf076fd82 | ||
|
|
2e4cd0384f | ||
|
|
a7dc943692 | ||
|
|
4b6d69d748 | ||
|
|
1145f010c6 | ||
|
|
d89e414ca7 | ||
|
|
58cd490639 | ||
|
|
f444003aee | ||
|
|
df3e2b55f9 | ||
|
|
09ac2fc5cf |
No files matched your search
@@ -19,7 +19,9 @@ bin
|
||||
.DS_Store
|
||||
.project
|
||||
.settings/
|
||||
.vscode/
|
||||
/target/
|
||||
settings.json
|
||||
|
||||
#
|
||||
manually/
|
||||
|
||||
@@ -9,3 +9,6 @@ Stand: 24.5.21
|
||||
simplifyRes, Basis fuer Plugin, sollte auf Plugin gemerged werden, noch keine Packages, Michael
|
||||
strucTypesNew, Struturelle Typen, alte Basis, arbeite derzeit niemand
|
||||
|
||||
Stand 21.2.23
|
||||
unif23: Testbranch fuer Tagungseinrecihung Unif23
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
## Bau und installation des Eclipse plugins
|
||||
|
||||
1. Zunächst muss der JavaTX Compiler gebaut werden. Dafür wird im Rootverzeichnis des JavaTX Compilers
|
||||
`mvn install` ausgeführt. Falls die Tests nicht laufen kann das mit `-DskipTests` beseitigt werden.
|
||||
|
||||
2. Dann muss das Plugin gebaut werden. Dafür muss ebenfalls `mvn install` ausgeführt werden, im Rootverzeichnis des Plugins.
|
||||
Falls es dabei zu Fehlern mit der Java-Version kommen sollte muss man in ~\.mavenrc oder \~.mavenrc_pre.bat die Zeile
|
||||
`set JAVA_HOME=<JDK-19-Pfad>` (Windows) oder `JAVA_HOME="<JDK-19-Pfad>"` (Linux) einfügen. Damit sollte maven korrekt konfiguriert sein.
|
||||
|
||||
3. Als letzter Schritt muss nun das Plugin in Eclipse geladen werden. Wichtig dabei ist, dass Eclipse selber mit Java 19 startet.
|
||||
Dafür kann die Datei `eclipse.ini` angepasst werden die im Installationsverzeichnis von Eclipse vorhanden ist. Hier müssen zwei Zeilen
|
||||
eingetragen werden:
|
||||
```
|
||||
-vm
|
||||
<JDK-19-Pfad>/javaw.exe
|
||||
```
|
||||
Ganz am Anfang der Datei
|
||||
und unter -vmargs die Option `--enable-preview`
|
||||
|
||||
4. Das gebaute Plugin befindet sich unter `JavaCompilerPlugin\releng\JavaCompilerPlugin.Update\target`
|
||||
Um dieses Plugin in Eclipse laden zu können muss den Dialog `Help > Install new Software` öffnen. Oben rechts steht die Option `Add...`
|
||||
Im sich öffnenden Dialog muss man `Archive` anklicken und dort das Zip Archiv aus dem Oben genannten Pfad einfügen. Nun mit Add den Dialog schließen.
|
||||
Als letztes muss in der Liste oben der Eintrag `JavaCompilerPlugin.Update` ausgewählt werden. Hier sollte nun unten das Plugin angezeigt werden.
|
||||
Einfach auswählen und unten Next drücken. Damit sollte der Vorgang abgeschlossen sein.
|
||||
@@ -42,7 +42,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>7.0</version>
|
||||
<version>9.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -51,13 +51,28 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<compilerArgs>--enable-preview</compilerArgs>
|
||||
<source>19</source>
|
||||
<target>19</target>
|
||||
<<<<<<< HEAD
|
||||
<source>20</source>
|
||||
<target>20</target>
|
||||
=======
|
||||
<release>20</release>
|
||||
>>>>>>> patternMatching
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<argLine>--enable-preview</argLine>
|
||||
<excludes>
|
||||
<exclude>**/JavaTXCompilerTest.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
@@ -112,8 +127,11 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<maven.compiler.source>19</maven.compiler.source>
|
||||
<maven.compiler.target>19</maven.compiler.target>
|
||||
<<<<<<< HEAD
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
=======
|
||||
>>>>>>> patternMatching
|
||||
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
@@ -123,4 +141,4 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<url>file:///${project.basedir}/maven-repository/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
</project>
|
||||
@@ -1,13 +0,0 @@
|
||||
class Box<A>{
|
||||
void m(A a){}
|
||||
}
|
||||
|
||||
class B { }
|
||||
|
||||
class Box_Main extends B {
|
||||
|
||||
m(b) {
|
||||
b.m(new Box_Main());
|
||||
b.m(new B());
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
class Box<A>{
|
||||
A f;
|
||||
}
|
||||
|
||||
class B { }
|
||||
|
||||
class Box_Main extends B {//Fehler Bugzilla Bug 230
|
||||
|
||||
m(b) {
|
||||
b.f = new Box_Main();
|
||||
b.f = new B();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.util.List;
|
||||
import java.lang.Integer;
|
||||
|
||||
class FCTest1 extends Vector<Vector<Integer>> {
|
||||
fc1() {
|
||||
var y;
|
||||
var z;
|
||||
y.add(z);
|
||||
return y;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.util.List;
|
||||
import java.lang.Integer;
|
||||
|
||||
class FCTest2 extends Vector<Vector<Integer>> {
|
||||
fc2(y) {
|
||||
var z;
|
||||
y.add(z);
|
||||
return y;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.lang.Integer;
|
||||
|
||||
class FCTest3 extends Pair<Vector<Integer>, Vector<Integer>> {
|
||||
|
||||
|
||||
fc2(x) {
|
||||
x.snd().addElement(2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
fc2a() {
|
||||
var y;
|
||||
y.snd().addElement(2);
|
||||
return y;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.util.Vector;
|
||||
|
||||
public class GenTest {
|
||||
|
||||
main(x) {
|
||||
var v = new Vector();
|
||||
return 1 + v.elementAt(0);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
class Generics {
|
||||
a;
|
||||
id(b) { return b; }
|
||||
setA(x) {
|
||||
a = x;
|
||||
return a;
|
||||
}
|
||||
m(x,y) { x = id(y); }
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
class Pair<T, U> {
|
||||
T x;
|
||||
U y;
|
||||
|
||||
public Pair() { }
|
||||
public Pair(T x, U y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public T fst () {
|
||||
return x;
|
||||
}
|
||||
|
||||
public U snd () {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class Iteration {
|
||||
id(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
m1(x, y) {
|
||||
var help;
|
||||
help = m2(x, y);
|
||||
var y2 = help.snd();
|
||||
var x2 = id(x);
|
||||
return new Pair<>(x2,y2);
|
||||
|
||||
}
|
||||
|
||||
m2(x,y) {
|
||||
var help = m1(x, y);
|
||||
var x2 = help.fst();
|
||||
var y2 = id(y);
|
||||
return new Pair<>(x2, y2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import java.util.List;
|
||||
class M {
|
||||
void m(p, p2){
|
||||
|
||||
new addList().addLists(p, p2);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import java.util.Stack;
|
||||
import java.util.Vector;
|
||||
|
||||
class OverloadingMain {
|
||||
|
||||
mmMain(x) { var y; return new O1().mm(y); }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
|
||||
|
||||
public class Overloading_Generics {
|
||||
|
||||
id1 (x) { return x; }
|
||||
|
||||
//Integer id (Integer x) { return x; }
|
||||
}
|
||||
|
||||
|
||||
class Overloading_Generics1 {
|
||||
main(x) {
|
||||
var olg = new Overloading_Generics();
|
||||
return olg.id1(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.util.Stack;
|
||||
|
||||
class OverrideMain {
|
||||
ovrMain(x) {
|
||||
var overide;
|
||||
overide.ovr(x);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
[
|
||||
[(TPH L = java.util.Stack<TPH FTM>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH FTN, TPH FTM), (TPH K = void)],
|
||||
[(TPH FTO, TPH FTP), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Stack<TPH FTP>), (TPH K = void)],
|
||||
[(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH K = void), (TPH FTR, TPH FTQ), (TPH L = java.util.Vector<TPH FTQ>)],
|
||||
[(TPH FTT, TPH FTS), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTS>), (TPH K = void), (TPH N = java.lang.String)],
|
||||
[(TPH L = java.util.Vector<TPH FTV>), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH FTU, TPH FTV), (TPH K = void)],
|
||||
[(TPH FTX, TPH FTW), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTW>), (TPH K = void), (TPH N = java.lang.String)],
|
||||
[(TPH M = ? extends Override2), (TPH L = java.util.Stack<TPH FTZ>), (TPH K = void), (TPH FTY, TPH FTZ), (TPH N = java.lang.String)],
|
||||
[(TPH FUB, TPH FUA), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUA>)],
|
||||
[(TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUC>), (TPH FUD, TPH FUC), (TPH M = ? extends Override2), (TPH K = void)],
|
||||
[(TPH N = java.lang.String), (TPH FUF, TPH FUE), (TPH M = ? extends Override2), (TPH K = void), (TPH L = java.util.Vector<TPH FUE>)]]
|
||||
|
||||
[[(TPH M = ? extends Override2), (TPH MNX, TPH MNY), (TPH N = java.lang.String), (TPH K = void), (TPH L = java.util.Stack<TPH MNY>)], [(TPH L = java.util.Stack<TPH MOC>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH K = void), (TPH MOB, TPH MOC)], [(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH MNZ, TPH MOA), (TPH L = java.util.Vector<TPH MOA>), (TPH K = void)], [(TPH L = java.util.Vector<TPH MOE>), (TPH K = void), (TPH M = ? extends Override2), (TPH MOD, TPH MOE), (TPH N = java.lang.String)], [(TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String), (TPH MOF, TPH MOG), (TPH L = java.util.Stack<TPH MOG>)], [(TPH L = java.util.Vector<TPH MOI>), (TPH K = void), (TPH MOH, TPH MOI), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOK>), (TPH MOJ, TPH MOK), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH MOL, TPH MOM), (TPH L = java.util.Stack<TPH MOM>), (TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOO>), (TPH MON, TPH MOO), (TPH N = java.lang.String), (TPH K = void), (TPH M = ? extends Override2)], [(TPH L = java.util.Stack<TPH MOP>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH MOQ, TPH MOP), (TPH K = void)]]
|
||||
*/
|
||||
@@ -1,11 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.util.Stack;
|
||||
|
||||
class OverrideMainRet {
|
||||
ovrMain() {
|
||||
var overide;
|
||||
var x;
|
||||
overide.ovr(x);
|
||||
return x;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ class Pair<U, T> {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
eq(a, b) {
|
||||
b = a;
|
||||
return a == b;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
class Pair<T, U> {
|
||||
T x;
|
||||
U y;
|
||||
|
||||
public Pair() { }
|
||||
public Pair(T x, U y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public T fst () {
|
||||
return x;
|
||||
}
|
||||
|
||||
public U snd () {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.util.Stack;
|
||||
|
||||
class Put {
|
||||
|
||||
putElement(ele, v) {
|
||||
v.addElement(ele);
|
||||
}
|
||||
|
||||
putElement(ele, s) {
|
||||
s.push(ele);
|
||||
}
|
||||
|
||||
|
||||
main(ele, x) {
|
||||
putElement(ele, x);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import java.util.stream.Stream;
|
||||
import java.util.Vector;
|
||||
import java.lang.Integer;
|
||||
|
||||
class StreamTest {
|
||||
|
||||
m() {
|
||||
var vecInt = new Vector<Integer>();
|
||||
var strInt = vecInt.stream();
|
||||
var dup = x -> x*2;
|
||||
strInt.map(dup);
|
||||
return dup;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
class Test {
|
||||
a;
|
||||
Test b;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
class TestSubTypless {
|
||||
m(a){
|
||||
var l = new ArrayList<>();
|
||||
l.add(a);
|
||||
return m2(l).get(0);
|
||||
}
|
||||
m2(a){
|
||||
return m(a);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
class Twice {
|
||||
twice = f -> x -> f.apply(f.apply(x));
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
class Var {
|
||||
|
||||
var(x) { var y; }
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.lang.Integer;
|
||||
|
||||
|
||||
public class VectorConstAdd {
|
||||
vectorAdd(v1) {
|
||||
var i = 0;
|
||||
var erg = new Vector<>();
|
||||
while (i < v1.size()) {
|
||||
erg.addElement(v1.elementAt(i) + 1);
|
||||
i++;
|
||||
}
|
||||
return erg;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import java.util.Vector;
|
||||
|
||||
class VectorNotObject {
|
||||
|
||||
vectorAddAll(v1, v2) {
|
||||
v1.addAll(v2);
|
||||
return v1;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import java.util.Vector;
|
||||
import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
|
||||
class WildcardCaptureConversionTest {
|
||||
|
||||
m(x, y ,z) {
|
||||
x = new Vector<Integer>();
|
||||
y = new Vector<String>();
|
||||
x.add(1);
|
||||
y.add("2");
|
||||
//Integer i = x.elementAt(0);
|
||||
//String s = y.elementAt(0);
|
||||
return z.vectorAddAll(x, y);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
class Wildcard_Andi {
|
||||
|
||||
Test<? extends A> ex = new Test<>();
|
||||
|
||||
Test<? super A> sup = new Test<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import java.util.List;
|
||||
|
||||
class addList {
|
||||
addLists(a, b){
|
||||
a.add(b.get(0));
|
||||
b.add(a.get(0));
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import java.util.List;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Object;
|
||||
import java.lang.Boolean;
|
||||
|
||||
class wildcardPair {
|
||||
|
||||
make(l) {
|
||||
var p = new Pair(l.get(0), l.get(1));
|
||||
return p;
|
||||
}
|
||||
//<X>Boolean compare(Pair<X, X> x) { return true; }
|
||||
void m(l) {
|
||||
Object o = l.get(0);
|
||||
|
||||
//Pair<? extends Object, ? extends Object> p;
|
||||
//List<?> b;
|
||||
//this.compare(p); //1, type incorrect
|
||||
make(l);
|
||||
//this.compare(this.make(b)); //2, OK
|
||||
}
|
||||
}
|
||||
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import java.lang.Integer;
|
||||
//import java.lang.Double;
|
||||
import java.lang.Double;
|
||||
|
||||
public class Fac {
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Faculty {
|
||||
|
||||
|
||||
|
||||
public getFact(x) {
|
||||
public getFact(java.lang.Integer x) {
|
||||
return fact.apply(x);
|
||||
}
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
public class Id {
|
||||
public class Id <FAU> {
|
||||
// a;
|
||||
// id(b){
|
||||
// return b;
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,32 +1,15 @@
|
||||
import java.lang.Double;
|
||||
import java.lang.String;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Double;
|
||||
import java.lang.Boolean;
|
||||
//import java.util.Vector;
|
||||
import java.lang.Long;
|
||||
|
||||
|
||||
public class OL {
|
||||
|
||||
java.lang.Double m(java.lang.Double x) { return x + x; }
|
||||
java.lang.Integer m(java.lang.Integer x) { return x + x; }
|
||||
java.lang.String m(java.lang.String x) { return x + x; }
|
||||
java.lang.Boolean m(Boolean x) { return x; }
|
||||
|
||||
// if the class contains just this method, then correct BC will be generated.
|
||||
// But if another methods are contained then the generated BC is not correct
|
||||
// m(x) {
|
||||
// //x.add(1);
|
||||
// x.addAll(x);
|
||||
// return x;
|
||||
// }
|
||||
|
||||
class OL {
|
||||
m (x) { return x + x; }
|
||||
}
|
||||
|
||||
public class OLMain {
|
||||
|
||||
main(x) {
|
||||
class OLMain {
|
||||
main(x) {
|
||||
var ol;
|
||||
ol = new OL();
|
||||
return ol.m(x);
|
||||
}
|
||||
ol = new OL();
|
||||
return ol.m(x);
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,8 +1,8 @@
|
||||
public class Tph2 {
|
||||
id = x->x;
|
||||
id3 (x) {
|
||||
return id.apply(x);
|
||||
}
|
||||
id = x->x;
|
||||
id3 (x) {
|
||||
return id.apply(x);
|
||||
}
|
||||
|
||||
/*
|
||||
m(a,b){
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,38 @@
|
||||
public class TestContraVariant {
|
||||
main(x, y) {
|
||||
var y2 = m(x, y);
|
||||
var y3 = y2.snd();
|
||||
var z;
|
||||
y3 = z;
|
||||
return new Pair<>(x, z);
|
||||
}
|
||||
|
||||
m(x, y) {
|
||||
var x2 = main(x, y);
|
||||
var x3 = x2.fst();
|
||||
var z;
|
||||
x3 = z;
|
||||
return new Pair<>(z, y);
|
||||
}
|
||||
}
|
||||
|
||||
class Pair<T, U> {
|
||||
public T x;
|
||||
public U y;
|
||||
|
||||
public Pair() {
|
||||
}
|
||||
|
||||
public Pair(T var1, U var2) {
|
||||
x = var1;
|
||||
y = var2;
|
||||
}
|
||||
|
||||
public T fst() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public U snd() {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
@@ -10,4 +10,5 @@ class TPHsAndGenerics2 {
|
||||
m2(a, b){
|
||||
return b;
|
||||
}
|
||||
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -3,7 +3,7 @@ import java.util.Vector;
|
||||
public class TestVector {
|
||||
|
||||
m(v, w) {
|
||||
w.addElement(id(v.elementAt(0)));
|
||||
w.addElement(id(v.elementAt(0)));
|
||||
}
|
||||
|
||||
id(x) {
|
||||
Loaded 100 of 301 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user