use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testOverrideGenericInterfaceMethod_9.
@Test
public void testOverrideGenericInterfaceMethod_9() throws Exception {
XtendInterface xtendInterface = interfaze(" import java.util.List import java.io.Serializable interface Foo<T> extends test.GenericSuperTypeInterface<T> { " + "override <T2, T1 extends Serializable & CharSequence> getValue9(List<T1> t)" + "}");
helper.assertNoErrors(xtendInterface);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceOverrideWithTypeParameter.
@Test
public void testInterfaceOverrideWithTypeParameter() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.GenericClass { override java.util.List<String> foo() }");
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 testInterfaceIncompatibleGenericReturnType_2.
@Test
public void testInterfaceIncompatibleGenericReturnType_2() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.SuperInterface { override java.util.ArrayList<String> returnsListExtendsObject() }");
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_2.
@Test
public void testOverrideGenericInterfaceMethod_2() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo<T> extends test.GenericSuperTypeInterface<T> { " + "override <T2> getValue2(T2[] t)" + "}");
helper.assertNoErrors(xtendInterface);
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class OverrideValidationTest method testInterfaceIncompatibleGenericReturnType_1.
@Test
public void testInterfaceIncompatibleGenericReturnType_1() throws Exception {
XtendInterface xtendInterface = interfaze("interface Foo extends test.SuperInterface { override java.util.List<Object> returnsListString() }");
helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, INCOMPATIBLE_RETURN_TYPE);
}
Aggregations