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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.5
    • 2.1.6
    • Static Type Checker
    • None
    • 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

            melix Cédric Champeau
            mpierce Marlon Pierce
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: