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

Compile time type of result of integer increment/decremnt is Object, not int?

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 2.1.6
    • Component/s: Static Type Checker
    • Labels:
      None
    • Environment:
      JVM 1.7.0_25, Groovy 2.1.5

      Description

      See https://bitbucket.org/marshallpierce/groovy-int-increment-decrement for a simple test case.

      See https://bitbucket.org/marshallpierce/groovy-int-increment-decrement/src/11bf750fb3a14441598841f819aca7b2f88f9474/src/main/groovy/IntIncrementDecrementTest.groovy?at=master for the source in question.

      It seems like if it's determining types statically, then it should know that i and j are ints, and that the type of i++ and ++j should also be int.

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              mpierce Marlon Pierce
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: