Skip to content

Commit d4016be

Browse files
Regression test for #4601 (#4620)
1 parent bad101c commit d4016be

File tree

1 file changed

+54
-0
lines changed
  • org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression

1 file changed

+54
-0
lines changed

org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13657,4 +13657,58 @@ public void accept(Integer t) {
1365713657
"----------\n"
1365813658
);
1365913659
}
13660+
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/4601
13661+
// New Compile Errors in Xtext Dev Workspace with newer jdt versions
13662+
public void testIssue4601() {
13663+
this.runNegativeTest(
13664+
new String[] {
13665+
"X.java",
13666+
"""
13667+
abstract class TraceForStorageProvider extends AbstractTraceForURIProvider<IFile, StorageAwareTrace> implements ITraceForStorageProvider {
13668+
13669+
}
13670+
13671+
13672+
abstract class AbstractTraceForURIProvider<SomeFile, Trace extends AbstractTrace> implements ITraceForURIProvider {
13673+
13674+
public Trace getTraceToSource(final SomeFile generatedFile) {
13675+
return null;
13676+
}
13677+
}
13678+
13679+
interface ITraceForStorageProvider extends IPlatformSpecificTraceProvider<IStorage, IEclipseTrace> {}
13680+
13681+
interface IPlatformSpecificTraceProvider<PlatformResource, Trace extends IPlatformSpecificTrace<PlatformResource, ?>> {
13682+
Trace getTraceToSource(PlatformResource derivedResource);
13683+
}
13684+
13685+
interface ITraceForURIProvider {}
13686+
13687+
interface IFile {}
13688+
13689+
interface IStorage {}
13690+
13691+
class StorageAwareTrace extends AbstractEclipseTrace {}
13692+
13693+
abstract class AbstractEclipseTrace extends AbstractTrace implements IEclipseTrace {}
13694+
abstract class AbstractTrace implements ITrace {}
13695+
13696+
interface ITrace {}
13697+
13698+
interface IEclipseTrace extends IPlatformSpecificTrace<IStorage, ILocationInEclipseResource> {}
13699+
13700+
interface ILocationInEclipseResource extends IPlatformSpecificLocation<IStorage> {}
13701+
13702+
interface IPlatformSpecificTrace<PlatformResource, Location extends IPlatformSpecificLocation<? extends PlatformResource>> extends ITrace {}
13703+
13704+
interface IPlatformSpecificLocation<PlatformResource> {}
13705+
"""
13706+
},
13707+
"----------\n" +
13708+
"1. ERROR in X.java (at line 1)\n" +
13709+
" abstract class TraceForStorageProvider extends AbstractTraceForURIProvider<IFile, StorageAwareTrace> implements ITraceForStorageProvider {\n" +
13710+
" ^^^^^^^^^^^^^^^^^^^^^^^\n" +
13711+
"Name clash: The method getTraceToSource(SomeFile) of type AbstractTraceForURIProvider<SomeFile,Trace> has the same erasure as getTraceToSource(PlatformResource) of type IPlatformSpecificTraceProvider<PlatformResource,Trace> but does not override it\n" +
13712+
"----------\n");
13713+
}
1366013714
}

0 commit comments

Comments
 (0)