use of org.eclipse.xtext.common.types.JvmMember in project xtext-xtend by eclipse.
the class InferredJvmModelTest method testInferredFunction_01.
@Test
public void testInferredFunction_01() throws Exception {
XtendFile xtendFile = file("class Foo { def bar() { true } }");
JvmGenericType inferredType = getInferredType(xtendFile);
XtendClass xtendClass = (XtendClass) xtendFile.getXtendTypes().get(0);
EList<JvmMember> jvmMembers = inferredType.getMembers();
assertEquals(2, jvmMembers.size());
JvmMember jvmMember = jvmMembers.get(1);
assertTrue(jvmMember instanceof JvmOperation);
XtendFunction xtendFunction = (XtendFunction) xtendClass.getMembers().get(0);
assertEquals(xtendFunction.getName(), jvmMember.getSimpleName());
assertEquals(jvmMember, associations.getDirectlyInferredOperation(xtendFunction));
assertEquals(xtendFunction, associations.getXtendFunction((JvmOperation) inferredType.getMembers().get(1)));
}
Aggregations