Kleine Änderungen, Fehlerbehebung
This commit is contained in:
parent
d7bb282d0f
commit
f1171210bc
@ -693,6 +693,7 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
|
|||||||
// Methode und Block teilen sich einen ReturnType:
|
// Methode und Block teilen sich einen ReturnType:
|
||||||
//this.block.setType(t);
|
//this.block.setType(t);
|
||||||
this.returntype = t;
|
this.returntype = t;
|
||||||
|
this.returntype.parent = this; //TODO: Dieser Hack sollte nicht nötig sein. (Parser ändern)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,8 +88,8 @@ public class Null extends Literal
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
public ConstraintsSet TYPEExpr(TypeAssumptions assumptions) {
|
||||||
// TODO Auto-generated method stub
|
this.setType(TypePlaceholder.fresh(this));
|
||||||
return null;
|
return new ConstraintsSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,6 +14,7 @@ import de.dhbwstuttgart.typeinference.ConstraintType;
|
|||||||
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
import de.dhbwstuttgart.typeinference.JavaCodeResult;
|
||||||
import de.dhbwstuttgart.typeinference.ResultSet;
|
import de.dhbwstuttgart.typeinference.ResultSet;
|
||||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||||
|
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||||
|
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ public abstract class Type extends SyntaxTreeNode implements IItemWithOffset
|
|||||||
// ino.method.Type.26732.body
|
// ino.method.Type.26732.body
|
||||||
{
|
{
|
||||||
//if(parent == null)throw new NullPointerException();
|
//if(parent == null)throw new NullPointerException();
|
||||||
|
//if(parent == null)throw new DebugException("Parent darf nicht null sein");
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.offset=offset;
|
this.offset=offset;
|
||||||
}
|
}
|
||||||
|
@ -327,10 +327,12 @@ public class TypeAssumptions {
|
|||||||
for(GenericVarAssumption ass : this.genericVarAssumptions){
|
for(GenericVarAssumption ass : this.genericVarAssumptions){
|
||||||
//if(ass.inheritsType(t))return t;
|
//if(ass.inheritsType(t))return t;
|
||||||
if(ass.getIdentifier().equals(t.getName())){
|
if(ass.getIdentifier().equals(t.getName())){
|
||||||
if(! ass.getAssumedType().getParentClass().equals(t.getParentClass())){
|
if(! ass.getAssumedType().getParentClass().equals(inNode.getParentClass())){ //hier muss nach der ParentClass von inNode gefragt werden, da die ParentClass von t nicht immer korrekt ist! (TODO: Überprüfen)
|
||||||
|
TypeAssumptions.log.debug(t+" ist NICHT in Klasse: "+ass.getAssumedType().getParentClass(), Section.TYPEINFERENCE);
|
||||||
//Ist die Generische Variable nicht aus dieser Klasse, so muss sie zu einem TPH umgewandelt werden:
|
//Ist die Generische Variable nicht aus dieser Klasse, so muss sie zu einem TPH umgewandelt werden:
|
||||||
return new ConstraintType(ass.getAssumedType().getTypePlaceHolder(inNode));
|
return new ConstraintType(ass.getAssumedType().getTypePlaceHolder(inNode));
|
||||||
}
|
}
|
||||||
|
TypeAssumptions.log.debug(t+" ist in Klasse: "+ass.getAssumedType().getParentClass(), Section.TYPEINFERENCE);
|
||||||
return new ConstraintType(ass.getAssumedType());
|
return new ConstraintType(ass.getAssumedType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user