forked from JavaTX/JavaCompilerCore
Fehler in TYPE-Methode von Constructor beheben
This commit is contained in:
parent
da70abf954
commit
5455ba803e
@ -23,6 +23,7 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertPoint;
|
||||
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Void;
|
||||
|
||||
public class Constructor extends Method {
|
||||
private Method methode;
|
||||
@ -55,7 +56,8 @@ public class Constructor extends Method {
|
||||
}
|
||||
@Override
|
||||
public ConstraintsSet TYPE(TypeAssumptions ass) {
|
||||
super.setType(new RefType(this.getParentClass().getName().toString(), this, this.getOffset()));
|
||||
//super.setType(this.getParentClass().getType());
|
||||
super.setType(new Void(this, 0));
|
||||
return super.TYPE(ass);
|
||||
}
|
||||
@Override
|
||||
|
@ -7,6 +7,8 @@ import de.dhbwstuttgart.syntaxtree.Field;
|
||||
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
||||
import de.dhbwstuttgart.syntaxtree.Method;
|
||||
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
|
||||
|
||||
public class ConstructorAssumption extends MethodAssumption{
|
||||
|
||||
@ -20,6 +22,13 @@ public class ConstructorAssumption extends MethodAssumption{
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getAssumedType() {
|
||||
throw new DebugException("Eine ConstructorAssumption hat keinen Typ bzw. er ist nicht relevant");
|
||||
//return this.getMethod().getParentClass().getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
String ret = "ConstructorAssumption: ";
|
||||
ret += this.getMethodName()+"(";
|
||||
|
Loading…
Reference in New Issue
Block a user