Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.6.5, 1.7-beta-2
-
Fix Version/s: 1.6.5, 1.7-beta-2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The code
#! /usr/bin/env groovy
def ifClosure = { ->
if ( 0 ) { 10 }
else { 20 }
}
def switchClosure = { ->
switch ( 0 ) {
case 0 : 10 ; break
default : 20 ; break
}
}
println ifClosure ( )
println switchClosure ( )
produces the output:
20
null
which seems inconsistent.
Fixed