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

Javac accepts ambiguous compound type

XMLWordPrintable

    • 5.0
    • 5.0
    • generic
    • generic

      Javac accepts this program:

      class Test2 <T extends I1 & I2> { }
       
      interface I1 {
          int getFoo();
      }
       
      interface I2 {
          float getFoo();
      }

      But correctly rejects this version:

      interface I1 {
          int getFoo();
      }
       
      interface I2 {
          float getFoo();
      }
       
      class Test2 <T extends I1 & I2> { }

            ahe Peter Ahe
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: