|
Groovy example source code file (AssignmentInsideExpressionBug.groovy)
The Groovy AssignmentInsideExpressionBug.groovy source code
package groovy.bugs
/**
* @version $Revision: 4996 $
*/
class AssignmentInsideExpressionBug extends GroovyTestCase {
void testBug() {
def x
if ((x = someMethod()) != null) {
println x
}
def y
if ((y = getFoo()) > 5) {
println "y is greater than 5"
}
def a = 123, b = 123
assert a == 123
assert b == 123
}
def someMethod() {
return "worked!"
}
def getFoo() {
return 7
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy AssignmentInsideExpressionBug.groovy source code file: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.