Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java =================================================================== --- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (revision 107) +++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (working copy) @@ -7381,4 +7381,43 @@ "SUCCESSSUCCESS" ); } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=174445 +public void test122() { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " enum Enum1 {\n" + + " value;\n" + + " }\n" + + " enum Enum2 {\n" + + " value;\n" + + " }\n" + + " static abstract class A {\n" + + " abstract U foo();\n" + + " }\n" + + " static class B extends A> {\n" + + " @Override\n" + + " Enum foo() {\n" + + " return Enum1.value;\n" + + " } \n" + + " }\n" + + " public static void main(String[] args) {\n" + + " A> a = new B();\n" + + " Enum2 value = a.foo();\n" + + " }\n" + + "}" + }, + "----------\n" + + "1. WARNING in X.java (at line 13)\n" + + " Enum foo() {\n" + + " ^^^^\n" + + "Type safety: The return type Enum for foo() from the type X.B needs unchecked conversion to conform to Enum from the type X.A>\n" + + "----------\n" + + "2. WARNING in X.java (at line 13)\n" + + " Enum foo() {\n" + + " ^^^^\n" + + "Type safety: The return type Enum for foo() from the type X.B needs unchecked conversion to conform to U from the type X.A\n" + + "----------\n"); } +}