diff --git a/src/mycompiler/mytype/TypePlaceholder.java b/src/mycompiler/mytype/TypePlaceholder.java index c996f9aa..49fdd18d 100755 --- a/src/mycompiler/mytype/TypePlaceholder.java +++ b/src/mycompiler/mytype/TypePlaceholder.java @@ -9,6 +9,8 @@ import java.util.Vector; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; +import typinferenz.TypeInsertPoint; +import typinferenz.TypeInsertable; import mycompiler.MyCompiler; import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; import mycompiler.mytypereconstruction.replacementlistener.IReplaceTypeEventProvider; @@ -508,6 +510,16 @@ public class TypePlaceholder extends Type implements IReplaceTypeEventProvider return equalType.printJavaCode(resultSet); } + + public Vector getTypeInsertPoints(ResultSet result) { + Vector ret = new Vector(); + for(ITypeReplacementListener ti : this.m_ReplacementListeners){ + if(ti instanceof TypeInsertable){ + new TypeInsertPoint(this, ti, result.getTypeEqualTo(this)); + } + } + return ret; + } } // ino.end diff --git a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java index c5fb7178..e3e9fb31 100755 --- a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java +++ b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java @@ -113,16 +113,17 @@ public class TypeinferenceResultSet } /** - * Berechnet alle möglichen Punkte zum Einsetzen eines Typs im Quelltext + * Berechnet alle möglichen Punkte zum Einsetzen eines Typs im Quelltext an der Stelle dieses TypePlaceholders * @return */ public Vector getTypeInsertionPoints(){ + Vector ret = new Vector(); for(Pair p : constraints){ for(TypePlaceholder tph : p.getTypePlaceholder()){ - + ret.addAll(tph.getTypeInsertPoints(this.unifiedConstraints)); } } - return null; + return ret; } } diff --git a/src/typinferenz/TypeInsertPoint.java b/src/typinferenz/TypeInsertPoint.java index 7c552d7b..94ead554 100644 --- a/src/typinferenz/TypeInsertPoint.java +++ b/src/typinferenz/TypeInsertPoint.java @@ -1,5 +1,11 @@ package typinferenz; +import mycompiler.mytype.*; + public class TypeInsertPoint { + public TypeInsertPoint(TypePlaceholder tph, TypeInsertable insertPoint, Type insertType){ + + } + }