Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6078

Chained null-safe navigation is broken in CompileStatic mode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.1.3
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      Chained elvis is broken in CompileStatic mode. Here's an example that reproduces the problem:

      @groovy.transform.CompileStatic
      def elvisNPE() {
          Map<String, Map<String,Integer>> m=[:]
          // this is ok
          println m?.a 
          // throws NPE   
          println m?.a?.b
      }
      elvisNPE()
      

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              lhotari Lari Hotari
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: