jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-1569

correct closure property access to field access the same way it is done this.x

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 3.0
  • Component/s: class generator
  • Labels:
    None

Description

this code:

class A {
  private foo = 1
  def getFoo(){
    10.times { println this.foo }
    return this.foo+1
  }
}

def a = new A()
println a.foo

should not end in a stack overflow

Issue Links

is depended upon by

Task - A task that needs to be done. GROOVY-2503 MOP 2.0 design inflluencing issues

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
blackdrag blackdrag added a comment - 13/Oct/08 7:23 AM

the stack overflow happens, because the closures { println this.foo } or {println foo} will call the getFoo method again, instead of accessing the field directly, like we usually do from any method.

Show
blackdrag blackdrag added a comment - 13/Oct/08 7:23 AM the stack overflow happens, because the closures { println this.foo } or {println foo} will call the getFoo method again, instead of accessing the field directly, like we usually do from any method.
Hide
Permalink
Andres Almiray added a comment - 20/May/11 10:21 AM

Still an issue with 1.8.0

Show
Andres Almiray added a comment - 20/May/11 10:21 AM Still an issue with 1.8.0

People

  • Assignee:
    blackdrag blackdrag
    Reporter:
    blackdrag blackdrag
Vote (0)
Watch (0)

Dates

  • Created:
    03/Dec/06 5:52 AM
    Updated:
    20/May/11 10:21 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.