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

Modifiers on local variables are ignored

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6-beta-2
    • Fix Version/s: 1.8.1
    • Component/s: ast builder
    • Labels:
      None

      Description

      In Java, at least, the only modifier allowed on local variables is "final." Groovy seems to accept and ignore all modifiers, final or otherwise. For example:

      class Foo {
      def bar()

      { volatile String xxx println xxx }

      }

      Compiles just fine.

      So there are really two issues here: (a) "final" semantics not being represented and enforced, and (b) all other modifiers not generating parse errors.

      For (a), the DeclarationExpression doesn't seem to have a place to hold modifiers; perhaps it should have an isFinal field?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                mcspanky Martin C. Martin
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: