Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 8u202
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      generic

      Description

      A DESCRIPTION OF THE PROBLEM :
      Error in check of type parameter bounds when wildcard is used as type argument. Same code successfully compiles by Eclipse compiler

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just try to compile provided source code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Successful compilation
      ACTUAL -
      /TestClass.java:7: error: type argument ? extends B is not within bounds of type-variable E
              C<? extends A, ? extends B> b = new C<A, B>();
                             ^
        where E,T are type-variables:
          E extends T declared in class C
          T extends Object declared in class C
      1 error

      ---------- BEGIN SOURCE ----------
      public class TestClass {
          public static class A {}
          public static class B extends A {}
          public static class C<T, E extends T> {}

          public static void main(String args[]) {
              C<? extends A, ? extends B> b = new C<A, B>();
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: