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

javac inference - shadowing compile error

    XMLWordPrintable

Details

    Description

      This program:

      public class Tmp
      {
          class S{}

          interface I<S, T extends S>{}

          class C implements I<C,C>{}
      }

      fails with errors:

      Tmp.java:7: error: type argument Tmp.C is not within bounds of type-variable S
          class C implements I<C,C>{}
                               ^
        where S is a type-variable:
          S extends Object declared in interface I
      Tmp.java:7: error: type argument Tmp.C is not within bounds of type-variable T
          class C implements I<C,C>{}
                                 ^
        where T is a type-variable:
          T extends Tmp.S declared in interface I
      2 errors

      if you comment class S out it compiles just fine.

      reported by Zhong Yu in compiler-dev list

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: