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

javac can show overload error messages that include non-valid candidates

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 9, 10
    • tools
    • None
    • b26

      javac gather lists of applicable and inapplicable candidates during overload resolution. There are no checks being done to restrict the addition of new members to those lists. For example it doesn't make sense to add a candidate method that is overridden by a method that is already in the list, or to add duplicate methods. But these lists are very permissive basically for performance reasons.

      If javac determines that there is no applicable method for a given invocation, then a curated list of inapplicable methods should be shown to the user. Currently duplicates are removed but overridden methods should be removed too, this last part is missing.

      The issue has been reported at [1] and a patch to fix it at [2]

      [1] http://mail.openjdk.java.net/pipermail/compiler-dev/2017-September/011061.html
      [2] http://mail.openjdk.java.net/pipermail/compiler-dev/2017-September/011075.html

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: