Search in sources :

Example 6 with XFunctionTypeRef

use of org.eclipse.xtext.xtype.XFunctionTypeRef in project xtext-xtend by eclipse.

the class ParserTest method testFunctionTypeRef_1.

@Test
public void testFunctionTypeRef_1() throws Exception {
    XtendFunction func = function("def (String)=>Boolean foo() { [String s|s==null]}");
    XFunctionTypeRef type = (XFunctionTypeRef) func.getReturnType();
    assertNotNull(type.getReturnType());
    assertEquals(1, type.getParamTypes().size());
    assertNotNull(type.getParamTypes().get(0));
}
Also used : XtendFunction(org.eclipse.xtend.core.xtend.XtendFunction) XFunctionTypeRef(org.eclipse.xtext.xtype.XFunctionTypeRef) Test(org.junit.Test)

Aggregations

XFunctionTypeRef (org.eclipse.xtext.xtype.XFunctionTypeRef)6 XtendFunction (org.eclipse.xtend.core.xtend.XtendFunction)5 Test (org.junit.Test)5 JvmTypeReference (org.eclipse.xtext.common.types.JvmTypeReference)3 XtendClass (org.eclipse.xtend.core.xtend.XtendClass)2 JvmParameterizedTypeReference (org.eclipse.xtext.common.types.JvmParameterizedTypeReference)2 EPackage (org.eclipse.emf.ecore.EPackage)1 RichString (org.eclipse.xtend.core.xtend.RichString)1 RichStringLiteral (org.eclipse.xtend.core.xtend.RichStringLiteral)1 XtendAnnotationType (org.eclipse.xtend.core.xtend.XtendAnnotationType)1 XtendEnum (org.eclipse.xtend.core.xtend.XtendEnum)1 XtendField (org.eclipse.xtend.core.xtend.XtendField)1 XtendFormalParameter (org.eclipse.xtend.core.xtend.XtendFormalParameter)1 XtendInterface (org.eclipse.xtend.core.xtend.XtendInterface)1 XtendMember (org.eclipse.xtend.core.xtend.XtendMember)1 XtendParameter (org.eclipse.xtend.core.xtend.XtendParameter)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 JvmGenericArrayTypeReference (org.eclipse.xtext.common.types.JvmGenericArrayTypeReference)1