use of org.abs_models.frontend.typechecker.TypeParameter in project abstools by abstools.
the class TypingTest method functionTypeArgs.
@Test
public void functionTypeArgs() {
Model m = assertParse(" def Maybe<A> f<A>() = None ;");
ParametricFunctionDecl d = getLastParametricFunctionDecl(m);
DataTypeType t = (DataTypeType) d.getTypeUse().getType();
TypeParameter typeArg = (TypeParameter) t.getTypeArg(0);
assertEquals(typeArg.getDecl(), d.getTypeParameter(0));
}
use of org.abs_models.frontend.typechecker.TypeParameter in project abstools by abstools.
the class TypingTest method functionTypeArgs3.
@Test
public void functionTypeArgs3() {
Model m = assertParse(" def A f<A>(Maybe<A> o) = case o { Just(a) => a; } ;");
ParametricFunctionDecl d = getLastParametricFunctionDecl(m);
TypeParameterDecl typeParameter = d.getTypeParameter(0);
TypeParameter type = (TypeParameter) ((ExpFunctionDef) d.getFunctionDef()).getRhs().getType();
TypeParameterDecl decl = type.getDecl();
assertEquals(typeParameter, decl);
}
Aggregations