generics in Construct

This commit is contained in:
Aldaron7 2018-03-21 14:09:28 +01:00
parent 4263ff671d
commit 9cdb5f05ef

View File

@ -88,19 +88,19 @@ public class Construct extends DefaultASTVisitor {
// For über alle FieldConstraints mit ClassType i // For über alle FieldConstraints mit ClassType i
this.constraintsSet.getFieldConstraints().stream().filter(fc -> fc.getClassType().equals(i)).forEach(fc -> { this.constraintsSet.getFieldConstraints().stream().filter(fc -> fc.getClassType().equals(i)).forEach(fc -> {
TypePlaceholder type = TypePlaceholder.fresh(i.getOffset()); TypePlaceholder type = TypePlaceholder.fresh(offset);
parameterInhTyterm.add(fc.getFieldType()); parameterInhTyterm.add(fc.getFieldType());
// TODO generics.add(new GenericTypeVar(s, bounds, offset, // TODO generics.add(new GenericTypeVar(s, bounds, offset,
// endOffset)); mit type // endOffset)); mit type
generics.add(new GenericTypeVar(new GenericTypeName(new GenericContext(name, null), type.getName()), generics.add(new GenericTypeVar(new GenericTypeName(new GenericContext(name, null), type.getName()),
new ArrayList<>(), offset, offset)); new ArrayList<>(), offset, offset));
Field field = new Field(fc.getFieldName(), type, Modifier.PUBLIC, i.getOffset()); Field field = new Field(fc.getFieldName(), type, Modifier.PUBLIC, offset);
fielddecl.add(field); fielddecl.add(field);
}); });
// For über alle MethodConstraints mit ClassType i // For über alle MethodConstraints mit ClassType i
this.constraintsSet.getMethodConstraints().stream().filter(mc -> mc.getClassType().equals(i)).forEach(mc -> { this.constraintsSet.getMethodConstraints().stream().filter(mc -> mc.getClassType().equals(i)).forEach(mc -> {
TypePlaceholder returnType = TypePlaceholder.fresh(i.getOffset()); TypePlaceholder returnType = TypePlaceholder.fresh(offset);
parameterInhTyterm.add(mc.getReturnType()); parameterInhTyterm.add(mc.getReturnType());
// TODO generics.add(new GenericTypeVar(s, bounds, offset, // TODO generics.add(new GenericTypeVar(s, bounds, offset,
// endOffset)); mit retrunType // endOffset)); mit retrunType