use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceOverrideReturnType_4.
@Test
public void testInterfaceOverrideReturnType_4() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.GenericSuperTypeInterface<Integer> { " + "override String getComparable()" + "}");
helper.assertNoErrors(xtendInterface);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceCompatibleThrowsClause_12.
@Test
public void testInterfaceCompatibleThrowsClause_12() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override generifiedRuntimeException() throws NullPointerException }");
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_3.
@Test
public void testDuplicateInterfaceMethod_3() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo { def void bar(java.util.List<String> x) def void bar(java.util.List<Integer> x) }");
helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, DUPLICATE_METHOD, "erasure", "List)", "List<String");
helper.assertError(xtendInterface.getMembers().get(1), XTEND_FUNCTION, DUPLICATE_METHOD, "erasure", "List)", "List<Integer");
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceOverrideReturnType_1.
@Test
public void testInterfaceOverrideReturnType_1() throws Exception {
XtendInterface xtendInterface = interfaze("import java.util.List import java.io.Serializable interface Foo<T> extends test.GenericSuperTypeInterface<T> { " + "override <T1> T1[] getValue1(List<T1> t)" + "}");
helper.assertNoErrors(xtendInterface);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testDuplicateInterfaceMethod_0.
// ***************************************************************************************************
// * and now the same for the interfaces
// ***************************************************************************************************
@Test
public void testDuplicateInterfaceMethod_0() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo { def void bar(int x) def void bar(int x) }");
helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, DUPLICATE_METHOD, "duplicate");
}
Aggregations