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

final keyword does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.5.4
    • None
    • None
    • None

    Description

      final greeting = 'Hello'
      
      greeting = 'Welcome'
      
      println greeting
      

      What I expect is that Groovy will complain greeting is final variable that should not be able to be modified.

      Actually, the code executed very well, and its result is: Welcome

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              daniel_sun Daniel Sun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: