[
https://issues.apache.org/jira/browse/GROOVY-3343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-3343.
---------------------------------
Resolution: Fixed
> Allow negative first argument without parentheses
> -------------------------------------------------
>
> Key: GROOVY-3343
> URL: https://issues.apache.org/jira/browse/GROOVY-3343
> Project: Groovy
> Issue Type: Improvement
> Affects Versions: 1.6-rc-1
> Reporter: Burns Boaz
> Priority: Major
>
> Here's a couple of simple tests to show the bug:
> Here is unit test that fails to run.
> {code}
> class NegativeParameterWithNoParenthesis extends GroovyTestCase
> {
> def foo(a, b) {}
> void testFooWithNegativeParameter()
> {
> foo(-1, 2)
> }
> void testFooWithNegativeParameterNoParenthesis()
> {
> foo -1, 2
> }
> }
> {code}
> -------------------------------- second test
> --------------------------------------
> {code}
> class TestDSL {
>
> def orientation( double azimuth, double elevation ) {
> println("azimuth = " + azimuth + " elevation = " + elevation);
> }
>
> def static process(dsl) {
> def closure = (Closure)new GroovyShell().evaluate("{->" + dsl + "}");
> closure.delegate = new TestDSL();
> closure();
> }
>
> }
> {code}
>
> here's the dsl file (which I named test.dsl):
> {code}
> orientation -45.0, 45.0
> {code}
>
> to run the test:
> {code}
> TestDSL.process(new File("test.dsl").text);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)