diff --git a/src/de/dhbwstuttgart/syntaxtree/Constructor.java b/src/de/dhbwstuttgart/syntaxtree/Constructor.java index e0e6b3f5e..1269e6b7f 100644 --- a/src/de/dhbwstuttgart/syntaxtree/Constructor.java +++ b/src/de/dhbwstuttgart/syntaxtree/Constructor.java @@ -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 diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/ConstructorAssumption.java b/src/de/dhbwstuttgart/typeinference/assumptions/ConstructorAssumption.java index 68f6112f3..ad3eb54ff 100644 --- a/src/de/dhbwstuttgart/typeinference/assumptions/ConstructorAssumption.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/ConstructorAssumption.java @@ -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()+"(";