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

Modifiers on local variables are ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6-beta-2
    • 1.8.1
    • ast builder
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: