[ 
https://issues.apache.org/jira/browse/GROOVY-10072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles updated GROOVY-10072:
---------------------------------
    Description: 
Consider the following:
{code:groovy}
@groovy.transform.CompileStatic
void test() {
  def c = { p = 'foo' -> return p }
  assert c('bar') == 'bar'
  assert c() == 'foo'

  c = { p, q = 'baz' -> return '' + p + q }
  assert c('foo', 'bar') == 'foobar'
  assert c('foo') == 'foobaz'
}
test()
{code}


  was:
Consider the following:
{code:groovy}
@groovy.transform.CompileStatic
void test() {
  def c = { p = 'foo' -> return p }
  assert c('bar') == 'bar'
  assert c() == 'foo'

c = { p, q = 'baz' -> return '' + p + q }
assert c('foo', 'bar') == 'foobar'
assert c('foo') == 'foobaz'
}
test()
{code}



> SC: closure with default argument(s)
> ------------------------------------
>
>                 Key: GROOVY-10072
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10072
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation, Static Type Checker
>    Affects Versions: 2.5.14, 3.0.8, 4.0.0-alpha-3
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>
> Consider the following:
> {code:groovy}
> @groovy.transform.CompileStatic
> void test() {
>   def c = { p = 'foo' -> return p }
>   assert c('bar') == 'bar'
>   assert c() == 'foo'
>   c = { p, q = 'baz' -> return '' + p + q }
>   assert c('foo', 'bar') == 'foobar'
>   assert c('foo') == 'foobaz'
> }
> test()
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to