modified: src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java

FunN-Types werden nach RefTypes mit FunN$$ nach Unifikation zurueckkonvertiert.

	modified:   target/JavaTXcompiler-0.1-jar-with-dependencies.jar
	modified:   test/bytecode/javFiles/Faculty.jav
	modified:   test/bytecode/javFiles/Lambda.jav
	modified:   test/bytecode/javFiles/OL.jav
	modified:   test/javFiles/Lambda.jav
This commit is contained in:
Martin Plümicke 2018-06-21 09:51:05 +02:00
parent b5bc9fa01a
commit 1991bbbcd3
6 changed files with 9 additions and 9 deletions

View File

@ -208,7 +208,7 @@ public class UnifyTypeFactory {
} }
public static RefTypeOrTPHOrWildcardOrGeneric convert(FunNType t, Map<String,TypePlaceholder> tphs) { public static RefTypeOrTPHOrWildcardOrGeneric convert(FunNType t, Map<String,TypePlaceholder> tphs) {
RefType ret = new RefType(new JavaClassName(t.getName()), convert(t.getTypeParams(), tphs), new NullToken()); RefType ret = new RefType(new JavaClassName(t.getName()+"$$"), convert(t.getTypeParams(), tphs), new NullToken());
return ret; return ret;
} }

View File

@ -5,12 +5,12 @@ class Faculty {
m () { m () {
var fact = (Integer x) -> { var fact = (Integer x) -> {
if (x == 1) { //if (x == 1) {
return x; return x;
} //}
else { //else {
return x * fact.apply(x-1); //return x * (fact.apply(x-1));
} //}
}; };
return fact; return fact;
} }

View File

@ -6,6 +6,6 @@ public class Lambda {
var lam1 = (Integer x) -> { var lam1 = (Integer x) -> {
return x; return x;
}; };
return lam1.apply(1); return lam1;
} }
} }

View File

@ -12,7 +12,7 @@ class OL {
class OLMain { class OLMain {
java.lang.Integer main(x) { main(x) {
var ol; var ol;
ol = new OL(); ol = new OL();
return ol.m(x); return ol.m(x);

View File

@ -4,7 +4,7 @@ import java.lang.Number;
public class Lambda { public class Lambda {
m () { m () {
var lam1 = (x) -> { var lam1 = (Integer x) -> {
return x; return x;
}; };
return lam1.apply(1); return lam1.apply(1);