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

calling trait method inside closure causes compiler error when CompileStatic is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.3.9, 2.4.1
    • 2.4.2
    • Static compilation
    • JDK: 1.7, O/S: windows

    Description

      Calling f2() within the each closure causes compiler error.

      @groovy.transform.CompileStatic
      trait MyTrait {
          def f() {
              ['a'].each {f2()}
          }
      
          def f2() {
              true
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              melix C├ędric Champeau
              wwwreynolds Bob Reynolds
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: