groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "余佳昕" <yjx_yujia...@foxmail.com>
Subject Method with completely capitalized method name, omitting parentheses when calling will cause compilation to fail
Date Wed, 08 Jul 2020 04:58:25 GMT
In groovy 2.5.*, the following code will fail to compile:
def TEST(String name) {
    println name
}
TEST 'hello'

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
ideaGroovyConsole.groovy: 108: unexpected token: hello @ line 108, column 6.
   TEST 'hello'
        ^

1 error
How to solve this problem?

It works in groovy 3.0.*, but I can't switch to groovy 3.0 yet.
Mime
View raw message