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

javac can incorrectly add primitive bounds during inference

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 8, 9
    • Fix Version/s: 9
    • Component/s: tools

      Description

      While compiling this code:

      class Test {
          <Z> Z m(Z z) { return null; }

          void test() {
              double d1 = m(1);
          }
      }

      the code is successfully compiled but javac adds an "int" bound during inference.

        Attachments

          Activity

            People

            • Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              vromero Vicente Arturo Romero Zaldivar
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: