Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160244 skip capture conversion before subtyping if types are parameterizations of the same class or interface
  3. JDK-8177854

Release Note: skip capture conversion before subtyping if types are parameterizations of the same class or interface

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Unresolved
    • P4
    • tbd
    • None
    • tools

    Description

      Code like this one:
      ```
      import java.util.stream.Stream;
       
      public class DontCaptureForTypesWithSameClassTest01 {
          interface I <E extends Exception> {}
       
          static public <E extends Exception> void m(I<? extends E>[] actions) throws E {
              foo(Stream.of(actions));
          }
       
          static public <E extends Exception> void foo(Stream<I<? extends E>> actions) throws E {}
      }
      ```
      used to work and it stopped being accepted by the compiler after fix for [JDK-8039214](https://bugs.openjdk.java.net/browse/JDK-8039214). It's not that fix for [JDK-8039214](https://bugs.openjdk.java.net/browse/JDK-8039214) was incorrect but that it uncovered bugs in the language specification and subsequently in the compiler implementation.

      The proposed solution for this issue is skip capture conversion before subtyping tests if both types being compared are parameterizations of the same class or interface.

      Attachments

        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: