use of org.abs_models.frontend.ast.ConstructorPattern in project abstools by abstools.
the class VarResolutionTest method testNestedPatternVar.
@Test
public void testNestedPatternVar() {
Model m = assertParse("data Foo = Bar(Bool); def Bool m(Foo f) = case f { Bar(y) => y; };");
assertThat(getFirstCaseExpr(m), instanceOf(VarUse.class));
ConstructorPattern p = (ConstructorPattern) getFirstCasePattern(m);
PatternVarDecl decl = ((PatternVar) p.getParam(0)).getVar();
assertEquals("y", decl.getName());
}
Aggregations