Search in sources :

Example 6 with ParametricFunctionDecl

use of abs.frontend.ast.ParametricFunctionDecl in project abstools by abstools.

the class TypingTest method functionTypeParams.

@Test
public void functionTypeParams() {
    Model m = assertParseOkStdLib(" def A f<A>(A a) = a ;");
    ParametricFunctionDecl d = getLastParametricFunctionDecl(m);
    assertEquals(d.getTypeParameter(0), ((TypeParameter) ((ExpFunctionDef) d.getFunctionDef()).getRhs().getType()).getDecl());
}
Also used : ParametricFunctionDecl(abs.frontend.ast.ParametricFunctionDecl) Model(abs.frontend.ast.Model) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Aggregations

FrontendTest (abs.frontend.FrontendTest)6 Model (abs.frontend.ast.Model)6 ParametricFunctionDecl (abs.frontend.ast.ParametricFunctionDecl)6 Test (org.junit.Test)6 ExpFunctionDef (abs.frontend.ast.ExpFunctionDef)3 TypeParameter (abs.frontend.typechecker.TypeParameter)3 TypeParameterDecl (abs.frontend.ast.TypeParameterDecl)2 DataTypeType (abs.frontend.typechecker.DataTypeType)2 Type (abs.frontend.typechecker.Type)1 UnionType (abs.frontend.typechecker.UnionType)1