use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testDuplicateInterfaceMethod_4.
@Test
public void testDuplicateInterfaceMethod_4() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo { def <T> void bar(T t) def <T> void bar(T t) }");
helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, DUPLICATE_METHOD, "duplicate", "bar(T)");
helper.assertError(xtendInterface.getMembers().get(1), XTEND_FUNCTION, DUPLICATE_METHOD, "duplicate", "bar(T)");
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceIncompatibleThrowsClause_04.
@Test
public void testInterfaceIncompatibleThrowsClause_04() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override generifiedIoException() throws java.net.URISyntaxException }");
helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, INCOMPATIBLE_THROWS_CLAUSE, "Exception", "URISyntaxException", "not", "compatible", "throws", "clause");
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceOverrideVoidFunction.
@Test
public void testInterfaceOverrideVoidFunction() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.SuperInterface { override voidFunction() }");
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 testOverrideGenericInterfaceMethod_5.
@Test
public void testOverrideGenericInterfaceMethod_5() throws Exception {
XtendInterface xtendInterface = interfaze(" import java.util.List interface Foo<T> extends test.GenericSuperTypeInterface<T> { " + "override <T3> getValue5(List<List<T3>[]> t) " + "}");
helper.assertNoErrors(xtendInterface);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceCompatibleThrowsClause_02.
@Test
public void testInterfaceCompatibleThrowsClause_02() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override nullPointerException() throws RuntimeException }");
helper.assertNoError(xtendInterface.getMembers().get(0), INCOMPATIBLE_THROWS_CLAUSE);
}
Aggregations