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

BUG! exception in phase 'instruction selection'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.15
    • Fix Version/s: 2.4.16, 2.5.0
    • Component/s: class generator
    • Labels:
      None
    • Environment:
      Windows 10, IntelliJ IDEA 2018.1.3, org.codehaus.groovy:groovy-all:2.4.15

      Description

      An error occurred when compiling a class of this construction:

      import groovy.transform.CompileStatic
      
      class TestCompileStatic {
        Closure func
      
        @CompileStatic
        void testCallFunc () {
          {color:#d04437}if (func != null) func('test'){color}
        }
      }
      

      > BUG! exception in phase 'instruction selection' in source unit 'TestCompileStatic.groovy' unexpected NullpointerException

      if you change the code to this:

      if (func != null) func.call('test')

      then the class is compiled correctly

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              ascrus Alexsey Konstantinov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: