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

Treat case labels as full type contexts for complete type annotation support in Record Patterns

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • None
    • None
    • tools
    • None

    Description

      In https://bugs.openjdk.org/browse/JDK-8297602 we address a situation of an compiler crash (assertion) with type annotations and generic records during pattern matching, by erasing the annotation and avoiding the crash:

      switch(p) {
         case Foo<@Annot(field = "") Integer>(): {} // crash
      };

      if (p instanceof Foo<@Annot(field = "") Integer>()) { // crash
      }

      A complete treatment with respect to case labels and annotations is tracked under the following specification enhancement:

      https://bugs.openjdk.org/browse/JDK-8298150

      This bug aims to track the implementation of the proposed spec changes.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              abimpoudis Angelos Bimpoudis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: