use of org.eclipse.xtend.core.xtend.XtendFormalParameter in project xtext-xtend by eclipse.
the class ParserTest method testMultiCatch_01.
@Test
public void testMultiCatch_01() throws Exception {
XtendClass clazz = clazz("class Foo { def void m() { try {} catch(NullPointerException | IllegalArgumentException e) {} } }");
assertEquals(1, clazz.getMembers().size());
XtendFunction m = (XtendFunction) clazz.getMembers().get(0);
XBlockExpression body = (XBlockExpression) m.getExpression();
assertEquals(1, body.getExpressions().size());
XTryCatchFinallyExpression tryCatch = (XTryCatchFinallyExpression) body.getExpressions().get(0);
XCatchClause singleCatchClause = tryCatch.getCatchClauses().get(0);
XtendFormalParameter parameter = (XtendFormalParameter) singleCatchClause.getDeclaredParam();
assertFalse(parameter.isExtension());
JvmSynonymTypeReference parameterType = (JvmSynonymTypeReference) parameter.getParameterType();
assertEquals(2, parameterType.getReferences().size());
}
Aggregations