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

unexpected compilation error with generic sealed interface

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 16
    • None
    • tools
    • None
    • b32

    Backports

      Description

        This code is being rejected by javac but should be accepted:

        class SealedExample
        {
          // Compiles if you remove `sealed` or if `I` is not generic.
          sealed interface I<T> {
            final class C implements I<Object> { }
          }

          static void f(final I<Object> x) {
            if (x instanceof I.C) {

            }
          }
        }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: