Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X a6e5328f8 -> 7563053a8


Fix the test 
groovy.transform.stc.MethodCallsSTCTest.testSpreadArgsForbiddenInClosureCall

(cherry picked from commit 45f90c7)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/7563053a
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7563053a
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7563053a

Branch: refs/heads/GROOVY_2_6_X
Commit: 7563053a8ec80daf7c571d097f5c55f8b186b5cc
Parents: a6e5328
Author: sunlan <sun...@apache.org>
Authored: Sat Aug 5 21:42:24 2017 +0800
Committer: sunlan <sun...@apache.org>
Committed: Sat Aug 5 21:43:27 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/7563053a/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() {

Reply via email to