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

Cast: compile reject sensible cast from final class to interface

    Details

    • Subcomponent:
    • Resolved In Build:
      b123
    • CPU:
      unknown
    • OS:
      generic
    • Verification:
      Verified

      Description

      After fix of 6932671 the compiler rejects the following code:

      class JavaApplication6 {

          public static <T extends CharSequence> Foo<T> createDeclarationUID(T declaration) {
              return (Foo<T>) new FooImpl();
          }

          public interface Foo<T> {
              
          }
          
          public static final class FooImpl implements Foo<String> {
              
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mcimadamore Maurizio Cimadamore
                Reporter:
                mcimadamore Maurizio Cimadamore
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: