You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (JIRA)" <ji...@apache.org> on 2018/06/21 15:32:00 UTC

[jira] [Created] (GROOVY-8657) Resource variable is accessible from finally block

Daniil Ovchinnikov created GROOVY-8657:
------------------------------------------

             Summary: Resource variable is accessible from finally block
                 Key: GROOVY-8657
                 URL: https://issues.apache.org/jira/browse/GROOVY-8657
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 3.0.0-alpha-2
            Reporter: Daniil Ovchinnikov


From http://groovy-lang.org/releasenotes/groovy-3.0.html
{code:groovy}
try(
        FromResource from = new FromResource("ARM was here!")
        ToResource to = new ToResource()
) {
    to << from
} finally {
    assert from.closed // should throw MissingPropertyException
    assert to.closed
    assert to.toString() == 'ARM was here!'
}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)