Repository: groovy Updated Branches: refs/heads/master 3b5958538 -> 45f90c76c
Fix the test groovy.transform.stc.MethodCallsSTCTest.testSpreadArgsForbiddenInClosureCall Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/45f90c76 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/45f90c76 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/45f90c76 Branch: refs/heads/master Commit: 45f90c76cda3c2837a2219626a0527f8479ee65d Parents: 3b59585 Author: sunlan <sun...@apache.org> Authored: Sat Aug 5 21:42:24 2017 +0800 Committer: sunlan <sun...@apache.org> Committed: Sat Aug 5 21:42:24 2017 +0800 ---------------------------------------------------------------------- .../groovy/transform/stc/MethodCallsSTCTest.groovy | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/45f90c76/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy ---------------------------------------------------------------------- diff --git a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy index d7c6573..cba7bdd 100644 --- a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy +++ b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy @@ -794,12 +794,21 @@ class MethodCallsSTCTest extends StaticTypeCheckingTestCase { } void testSpreadArgsForbiddenInClosureCall() { - shouldFailWithMessages ''' + boolean isAntlr2Parser = config.isAntlr2Parser() + + String code = ''' def closure = { String a, String b, String c -> println "$a $b $c" } def strings = ['A', 'B', 'C'] closure(*strings) - ''', - 'The spread operator cannot be used as argument of method or closure calls with static type checking because the number of arguments cannot be determined at compile time' + ''' + + if (isAntlr2Parser) { + shouldFailWithMessages code, 'The spread operator cannot be used as argument of method or closure calls with static type checking because the number of arguments cannot be determined at compile time' + } else { + shouldFailWithMessages code, + 'The spread operator cannot be used as argument of method or closure calls with static type checking because the number of arguments cannot be determined at compile time', + 'Closure argument types: [java.lang.String, java.lang.String, java.lang.String] do not match with parameter types: [java.lang.Object]' + } } void testBoxingShouldCostMore() {