Bugfix
This commit is contained in:
parent
276ff44756
commit
07b159f9a3
@ -20,12 +20,11 @@ public class TypeInferenceBlockInformation extends TypeInferenceInformation {
|
||||
public TypeInferenceBlockInformation(Set<ClassOrInterface> availableClasses,
|
||||
ClassOrInterface currentClass, TypeScope methodContext) {
|
||||
super(availableClasses);
|
||||
this.methodContext = methodContext;
|
||||
this.methodContext = new TypeScopeContainer(currentClass, methodContext);
|
||||
this.currentClass = currentClass;
|
||||
}
|
||||
public TypeInferenceBlockInformation(TypeInferenceBlockInformation oldScope, TypeScope newScope) {
|
||||
this(oldScope.getAvailableClasses(), oldScope.currentClass, oldScope.methodContext);
|
||||
methodContext = new TypeScopeContainer(methodContext, newScope);
|
||||
}
|
||||
public ClassOrInterface getCurrentClass() {
|
||||
return currentClass;
|
||||
|
@ -36,7 +36,7 @@ public class ConstraintsFactory {
|
||||
if(type instanceof GenericRefType){
|
||||
//TODO: Für Generics müssen auch noch Constraints generiert werden
|
||||
for(GenericTypeVar genericTypeVar : currentScope.getGenerics()){
|
||||
if(genericTypeVar.getName().equals(((GenericRefType)type).getName())){
|
||||
if(genericTypeVar.getName().toString().equals(((GenericRefType)type).getName().toString())){
|
||||
return new RefType(((GenericRefType)type).getName(),type.getOffset());
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class TYPE {
|
||||
}
|
||||
|
||||
private ConstraintSet getConstraintsConstructor(Constructor m, TypeInferenceInformation info, ClassOrInterface currentClass) {
|
||||
TypeInferenceBlockInformation blockInfo = new TypeInferenceBlockInformation(info.getAvailableClasses(), currentClass, null);
|
||||
TypeInferenceBlockInformation blockInfo = new TypeInferenceBlockInformation(info.getAvailableClasses(), currentClass, m);
|
||||
TYPEStmt methodScope = new TYPEStmt(blockInfo);
|
||||
//for(Statement stmt : m.fieldInitializations)stmt.accept(methodScope);
|
||||
ConstraintSet ret = this.getConstraintsMethod(m, info, currentClass);
|
||||
|
@ -223,7 +223,7 @@ public class TYPEStmt implements StatementVisitor{
|
||||
return new TypeScope() {
|
||||
@Override
|
||||
public Iterable<? extends GenericTypeVar> getGenerics() {
|
||||
return null;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user