forked from JavaTX/JavaCompilerCore
Fehler in TypeDeplyment behoben
This commit is contained in:
parent
46291a6056
commit
1371220249
@ -29,6 +29,7 @@ import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.FunN;
|
||||
import de.dhbwstuttgart.syntaxtree.type.FunVoidN;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.ObjectType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
@ -37,7 +38,6 @@ import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.syntaxtree.type.WildcardType;
|
||||
import de.dhbwstuttgart.typeinference.ConstraintsSet;
|
||||
import de.dhbwstuttgart.typeinference.FunVoidN;
|
||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||
import de.dhbwstuttgart.typeinference.OderConstraint;
|
||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package de.dhbwstuttgart.typeinference;
|
||||
package de.dhbwstuttgart.syntaxtree.type;
|
||||
|
||||
|
||||
import java.util.Iterator;
|
||||
@ -7,22 +7,15 @@ import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.parser.JavaClassName;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.ParameterList;
|
||||
import de.dhbwstuttgart.syntaxtree.type.FunN;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.RefType;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.MethodAssumption;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
|
||||
/**
|
||||
* @see Spezifikation "Complete Typeinference in Java 8" von Martin Plümicke
|
||||
* "interface FunN<R,T1, T2, ... ,TN> { R apply(T1 arg1, T2 arg2, ... , TN argN); }"
|
||||
* FunVoid<T1,...,TN> {
|
||||
* void apply(T1 arg1, ... TN argN);
|
||||
* }
|
||||
* @author A10023 - Andreas Stadelmeier
|
||||
*
|
||||
* Bemerkung:
|
||||
* FunN ist ein RefType. Der RefType ist nicht mit einem FunNInterface verbunden.
|
||||
*
|
||||
*/
|
||||
public class FunVoidN extends FunN {
|
||||
|
@ -234,6 +234,10 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet){
|
||||
return new JavaCodeResult(this.name.toString());
|
||||
}
|
||||
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet, boolean resolveTPHs){
|
||||
return printJavaCode(resultSet);
|
||||
}
|
||||
|
||||
public Type applyResultSet(ResultSet result){
|
||||
return this.clone();
|
||||
|
@ -401,6 +401,10 @@ public class TypePlaceholder extends ObjectType
|
||||
return equalType.printJavaCode(resultSet);
|
||||
}
|
||||
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet, boolean resolveTPHs){
|
||||
if(resolveTPHs)return printJavaCode(resultSet);
|
||||
return new JavaCodeResult(this.get_Name());
|
||||
}
|
||||
/**
|
||||
* Berechnet die InsertPoints dieses TypePlaceholders.
|
||||
* Alle an diesem TypePlaceholder registrierten ITypeReplacementListener werden darauf kontrolliert,
|
||||
|
@ -210,9 +210,9 @@ class GenericVarExtendsDeclarationPatch {
|
||||
public String getInsertString(ResultSet resultSet){
|
||||
String ret = "";
|
||||
if(this.genericPair != null){
|
||||
ret += this.genericPair.TA1.printJavaCode(resultSet);
|
||||
ret += this.genericPair.TA1.printJavaCode(resultSet, false);
|
||||
ret += " extends ";
|
||||
ret += this.genericPair.TA2.printJavaCode(resultSet);
|
||||
ret += this.genericPair.TA2.printJavaCode(resultSet, false);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
class Matrix {
|
||||
op = (f) -> f.apply(2);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user