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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: tools
    • None

      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.

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

              Created:
              Updated: