use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class TypeProviderTest method testParameterizedExtension_12.
@Test
public void testParameterizedExtension_12() throws Exception {
XtendFile file = file("package testPackage\n" + "import org.eclipse.xtext.testing.util.ParseHelper\n" + "import org.eclipse.xtend.core.xtend.XtendFile\n" + "class C<F extends XtendFile, T extends ParseHelper<F>> {\n" + " extension T\n" + " def m() {" + " ''.parse\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall parse = findSingleFeatureCall(c);
assertEquals("org.eclipse.xtext.testing.util.ParseHelper.parse(java.lang.CharSequence)", parse.getFeature().getIdentifier());
assertEquals("F", getType(parse).getSimpleName());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class TypeProviderTest method testDeferredTypeArgumentResolution_04.
@Ignore("TODO")
@Test
public void testDeferredTypeArgumentResolution_04() throws Exception {
XtendFile file = file("package testPackage\n" + "class C {\n" + " def <T> T method(java.util.Collection<T> c, (T, T)=>T fun) {}\n" + " def m() {\n" + " method(newArrayList('')) [ CharSequence cs, s2 | cs + s2 ]\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall head = findSingleFeatureCall(c);
assertEquals("CharSequence", getType(head).getSimpleName());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class TypeProviderTest method testDeferredTypeArgumentResolution_05.
@Ignore("TODO")
@Test
public void testDeferredTypeArgumentResolution_05() throws Exception {
XtendFile file = file("package testPackage\n" + "class C {\n" + " def <T> T method(java.util.Collection<T> c, (T, T)=>T fun) {}\n" + " def m() {\n" + " method(newArrayList('')) [ s1, s2 | null as CharSequence ]\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall head = findSingleFeatureCall(c);
assertEquals("CharSequence", getType(head).getSimpleName());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class TypeProviderTest method testParameterizedExtension_10.
@Test
public void testParameterizedExtension_10() throws Exception {
XtendFile file = file("package testPackage\n" + "import org.eclipse.xtext.testing.util.ParseHelper\n" + "import org.eclipse.xtend.core.xtend.XtendFile\n" + "class C<T extends ParseHelper<XtendFile>> {\n" + " extension T\n" + " def m() {" + " ''.parse\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall parse = findSingleFeatureCall(c);
assertEquals("org.eclipse.xtext.testing.util.ParseHelper.parse(java.lang.CharSequence)", parse.getFeature().getIdentifier());
assertEquals("XtendFile", getType(parse).getSimpleName());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class TypeProviderTest method testParameterizedExtension_07.
@Test
public void testParameterizedExtension_07() throws Exception {
XtendFile file = file("package testPackage\n" + "import org.eclipse.xtext.testing.util.ParseHelper\n" + "import org.eclipse.xtend.core.xtend.XtendFile\n" + "class C<F extends XtendFile> extends ParseHelper<F> {\n" + " def m() {" + " ''.parse\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall parse = findSingleFeatureCall(c);
assertEquals("org.eclipse.xtext.testing.util.ParseHelper.parse(java.lang.CharSequence)", parse.getFeature().getIdentifier());
assertEquals("F", getType(parse).getSimpleName());
}
Aggregations