Fehler in TypeDeplyment behoben

This commit is contained in:
JanUlrich 2015-09-28 16:35:01 +02:00
parent 46291a6056
commit 1371220249
6 changed files with 16 additions and 15 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -235,6 +235,10 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset
return new JavaCodeResult(this.name.toString());
}
public JavaCodeResult printJavaCode(ResultSet resultSet, boolean resolveTPHs){
return printJavaCode(resultSet);
}
public Type applyResultSet(ResultSet result){
return this.clone();
}

View File

@ -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,

View File

@ -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;
}