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

invalid octal split into two arguments

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: parser-antlr
    • Labels:
      None

      Description

      ​println 09​

      This code will cause a NPE, because it will be evaluated as println 0 9, which is evaluated as println(0).9. This happens because the leading zero introduces an octal, but 09 is no octal. The parser no falsely accepts 0 as valid number and does not recognize that 09 is supposed to be a single number anymore.

      The expected behaviour is a compile time failure.

      Daniel, can we fix that in parrot?

        Activity

        Hide
        daniel_sun Daniel Sun added a comment -

        Jochen, I think it can be fixed in Parrot

        Show
        daniel_sun Daniel Sun added a comment - Jochen, I think it can be fixed in Parrot
        Hide
        blackdrag Jochen Theodorou added a comment -

        +1

        Show
        blackdrag Jochen Theodorou added a comment - +1
        Show
        daniel_sun Daniel Sun added a comment - Fixed by https://github.com/apache/groovy/commit/90be9e50df449bc20d827ec7758bcd444713d40c

          People

          • Assignee:
            daniel_sun Daniel Sun
            Reporter:
            blackdrag Jochen Theodorou
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development