Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7039014

Confusing error message for method conflict

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      The error message for incompatible inherited methods doesn't account for the possibility that both methods could come from the same class. The message could be improved:

      InstanceClash.java:13: error: types Foo<String> and Foo<String> are incompatible; both define m(java.lang.String), but with unrelated return types
        interface I extends Foo<String> {}
        ^
      Here's the relevant source:

        public static interface Foo<S> {
          String m(String s);
          int m(S o);
        }

        interface I extends Foo<String> {}

        Attachments

          Activity

            People

            • Assignee:
              dlsmith Dan Smith
              Reporter:
              dlsmith Dan Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: