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-346

implicit return does not commute

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-4
  • Fix Version/s: None
  • Component/s: class generator
  • Labels:
    None

Description

def func() { "hello" }

is not equivalent to

def func() { block: { "hello" } )

the former returns "hello", the latter "null".

The two are logically equivalent in every other respect, and probably should be equivalent in this respect, too.

It would also be nice if this worked as expected:

def func( test )
{
if( test )

{ "hello" }

else

{ "goodbye" }

}

Being a ruby-ite, I expect this to return "hello" or "goodbye", not null.

Issue Links

is depended upon by

Task - A task that needs to be done. GROOVY-753 complete parser

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Guillaume Laforge added a comment - 02/Nov/07 5:33 AM

I think this issue has long been solved.

Show
Guillaume Laforge added a comment - 02/Nov/07 5:33 AM I think this issue has long been solved.

People

  • Assignee:
    Guillaume Laforge
    Reporter:
    Chris Poirier
Vote (0)
Watch (1)

Dates

  • Created:
    30/Mar/04 7:28 PM
    Updated:
    02/Nov/07 5:33 AM
    Resolved:
    02/Nov/07 5:33 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.