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

CompileStatic: in operator (isCase) isn't null safe in CS mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 2.1.4
    • Static compilation
    • None

    Description

      in operator is null safe in dynamic compilation mode (I guess that's because of the internal NullObject).
      Similar code throws an exception in static compilation mode.

      example:

      def isCaseNull(a, b) {
         a in b
      }
      
      @groovy.transform.CompileStatic
      def isCaseNullCS(a, b) {
         a in b
      }
      
      isCaseNull(1, null)
      isCaseNullCS(1, null)
      

      Attachments

        Issue Links

          Activity

            People

              melix Cédric Champeau
              lhotari Lari Hotari
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: