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

Message "This method should not have been called" on script with nested loops and @CompileStatic

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-3
    • Fix Version/s: 2.0-rc-1
    • Component/s: class generator
    • Environment:

      Description

      I was creating a small benchmarking for BigDecimal operations under @CompileStatic and after a nested loop the following message came:

      Caught: BUG! exception in phase 'class generation' in source unit '/media/CHRONICLES/info/groovy/scripts/BugG2b3.groovy' At line 13 column 13
      On receiver: curr.call() with message: minus and arguments: t0
      This method should not have been called. Please try to create a simple example reproducing this error and filea bug report at http://jira.codehaus.org/browse/GROOVY
      BUG! exception in phase 'class generation' in source unit '/media/CHRONICLES/info/groovy/scripts/BugG2b3.groovy' At line 13 column 13
      On receiver: curr.call() with message: minus and arguments: t0
      This method should not have been called. Please try to create a simple example reproducing this error and filea bug report at http://jira.codehaus.org/browse/GROOVY
      

      Happens with or without --indy, and with or without indy jar.
      Happens only with @CompileStatic.

      Commenting the 5.times { "solves" the problem.

      Swapping the "5.times" by
      for (int i = 0; i < 5; i++)
      or by
      for (i in 1..5)
      or
      (1..5).each
      doesn't solve the problem.

        Attachments

        1. BugG2b3.groovy
          0.2 kB
          Will P

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              willpiasecki Will P
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: