diff --git a/src/main/java/edu/kit/typicalc/model/TypeVariableFactory.java b/src/main/java/edu/kit/typicalc/model/TypeVariableFactory.java index 3a9669e..da28271 100644 --- a/src/main/java/edu/kit/typicalc/model/TypeVariableFactory.java +++ b/src/main/java/edu/kit/typicalc/model/TypeVariableFactory.java @@ -7,11 +7,15 @@ import edu.kit.typicalc.model.type.TypeVariable; */ public class TypeVariableFactory { + private static final int FIRST_VARIABLE_INDEX = 1; + + private int nextVariableIndex; + /** * Initializes a new type variable factory. */ protected TypeVariableFactory() { - // TODO + nextVariableIndex = FIRST_VARIABLE_INDEX; } /** @@ -20,7 +24,8 @@ public class TypeVariableFactory { * @return a new unique type variable */ public TypeVariable nextTypeVariable() { - return null; - // TODO + TypeVariable nextTypeVariable = new TypeVariable(nextVariableIndex); + nextVariableIndex++; + return nextTypeVariable; } } diff --git a/src/main/java/edu/kit/typicalc/model/type/TypeVariable.java b/src/main/java/edu/kit/typicalc/model/type/TypeVariable.java index 3c394fe..9e92658 100644 --- a/src/main/java/edu/kit/typicalc/model/type/TypeVariable.java +++ b/src/main/java/edu/kit/typicalc/model/type/TypeVariable.java @@ -1,4 +1,7 @@ package edu.kit.typicalc.model.type; public class TypeVariable { + public TypeVariable(int index) { + + } }