Search in sources :

Example 6 with TypeParameter

use of abs.frontend.typechecker.TypeParameter in project abstools by abstools.

the class TypeExtensionHelper method checkDataConstructorExp.

public void checkDataConstructorExp(DataConstructorExp e) {
    DataConstructor decl = (DataConstructor) e.getDecl();
    if (decl.getDataTypeDecl() instanceof ParametricDataTypeDecl) {
        HashMap<TypeParameter, Type> map = new HashMap<>();
        for (int i = 0; i < decl.getNumConstructorArg(); i++) {
            Type rht = e.getParam(i).getType();
            Type arg = decl.getConstructorArg(i).getType();
            checkTypeParameter(map, rht, arg, e.getParam(i));
        }
    }
}
Also used : TypeParameter(abs.frontend.typechecker.TypeParameter) BoundedType(abs.frontend.typechecker.BoundedType) Type(abs.frontend.typechecker.Type) DataTypeType(abs.frontend.typechecker.DataTypeType) HashMap(java.util.HashMap)

Aggregations

TypeParameter (abs.frontend.typechecker.TypeParameter)6 DataTypeType (abs.frontend.typechecker.DataTypeType)4 FrontendTest (abs.frontend.FrontendTest)3 Model (abs.frontend.ast.Model)3 ParametricFunctionDecl (abs.frontend.ast.ParametricFunctionDecl)3 BoundedType (abs.frontend.typechecker.BoundedType)3 Type (abs.frontend.typechecker.Type)3 Test (org.junit.Test)3 ExpFunctionDef (abs.frontend.ast.ExpFunctionDef)2 TypeParameterDecl (abs.frontend.ast.TypeParameterDecl)2 HashMap (java.util.HashMap)2