Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.x
-
None
Description
In this code:
final begin try { begin = new Date() } finally { println 'done' }
The current error is:
The variable [begin] may be uninitialized
But this should only happen if begin is used in the catch or finally blocks or prior to the first assignment.
This impacts Spock usage since it converts the following into something similar to above:
@Grab('org.spockframework:spock-core:1.1-groovy-2.4-SNAPSHOT') @GrabExclude('org.codehaus.groovy:groovy-all') import spock.lang.Specification class DummySpec extends Specification { def 'FVA when using Spock'() { given: final begin = new Date() cleanup: println 'done' } }
Attachments
Attachments
Issue Links
- links to