use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceIncompatibleReturnType_1.
@Test
public void testInterfaceIncompatibleReturnType_1() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.SuperInterface { override String object() }");
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 OverrideValidationTest method testInterfaceCompatibleThrowsClause_11.
@Test
public void testInterfaceCompatibleThrowsClause_11() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override generifiedIoException() throws java.io.IOException }");
helper.assertNoError(xtendInterface.getMembers().get(0), INCOMPATIBLE_THROWS_CLAUSE);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testDuplicateInterfaceMethod_6.
@Test
public void testDuplicateInterfaceMethod_6() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo { def <T> void bar(CharSequence seq) def <V extends CharSequence> void bar(V v) }");
helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, DUPLICATE_METHOD, "erasure", "CharSequence)");
helper.assertError(xtendInterface.getMembers().get(1), XTEND_FUNCTION, DUPLICATE_METHOD, "erasure", "CharSequence)", "bar(V)");
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testOverrideGenericInterfaceMethod_12.
@Test
public void testOverrideGenericInterfaceMethod_12() throws Exception {
XtendInterface xtendInterface = interfaze(" interface Foo<T> extends test.GenericSuperTypeInterface<T> { " + "override <Unused> void foo2(T t, (T)=>void proc) " + "}");
helper.assertNoErrors(xtendInterface);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceCompatibleThrowsClause_03.
@Test
public void testInterfaceCompatibleThrowsClause_03() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override noException() throws RuntimeException }");
helper.assertNoError(xtendInterface.getMembers().get(0), INCOMPATIBLE_THROWS_CLAUSE);
}
Aggregations