groovy

final keyword does not work

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.5.4
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

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

Issue Links

Activity

Hide
Paul King added a comment - - edited

Duplicate of GROOVY-1628

Show
Paul King added a comment - - edited Duplicate of GROOVY-1628
Hide
Glyn Normington added a comment -

I think the fix version is incorrect as this problem still exhibits in Groovy 1.8.4.

GROOVY-1628 is unresolved, so I don't think this duplicate should have any fix version.

Show
Glyn Normington added a comment - I think the fix version is incorrect as this problem still exhibits in Groovy 1.8.4. GROOVY-1628 is unresolved, so I don't think this duplicate should have any fix version.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: