use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testDuplicateInterfaceMethod_2.
@Test
public void testDuplicateInterfaceMethod_2() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo { def void bar(String x) def void bar(String x, int x) }");
helper.assertNoError(xtendInterface, DUPLICATE_METHOD);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testOverrideGenericInterfaceMethod_10.
@Test
public void testOverrideGenericInterfaceMethod_10() throws Exception {
XtendInterface xtendInterface = interfaze(" interface Foo<T> extends test.GenericSuperTypeInterface<T> { " + "override <T extends String> foo1()" + "}");
helper.assertError(xtendInterface, XTEND_FUNCTION, DUPLICATE_METHOD);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceIncompatibleGenericReturnType_0.
@Test
public void testInterfaceIncompatibleGenericReturnType_0() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.SuperInterface { override java.util.ArrayList<String> returnsListString() }");
helper.assertNoError(xtendInterface.getMembers().get(0), INCOMPATIBLE_RETURN_TYPE);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class XtendValidationTest method testNonAbstractMethodInInterface.
@Test
public void testNonAbstractMethodInInterface() throws Exception {
XtendInterface clazz = interfaze("interface Foo { def test() {} }");
helper.assertError(clazz.getMembers().get(0), XTEND_FUNCTION, ABSTRACT_METHOD_WITH_BODY);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceIncompatibleReturnType_2.
@Test
public void testInterfaceIncompatibleReturnType_2() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.SomeInterface { override void foo() }");
helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, INCOMPATIBLE_RETURN_TYPE);
}
Aggregations