Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 8c1e78986 -> 305c29363


GROOVY-7784: TypeChecked/CompileStatic: IndexOutOfBoundsException (a few more 
tests)


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 305c29363dd0cc616bc76bd29d26f0b3845b85ff
Parents: 8c1e789
Author: paulk <pa...@asert.com.au>
Authored: Fri May 27 18:46:51 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Fri May 27 18:47:52 2016 +1000

----------------------------------------------------------------------
 .../groovy/classgen/asm/sc/BugsStaticCompileTest.groovy | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/305c2936/src/test/org/codehaus/groovy/classgen/asm/sc/BugsStaticCompileTest.groovy
----------------------------------------------------------------------
diff --git 
a/src/test/org/codehaus/groovy/classgen/asm/sc/BugsStaticCompileTest.groovy 
b/src/test/org/codehaus/groovy/classgen/asm/sc/BugsStaticCompileTest.groovy
index da87665..9a4491d 100644
--- a/src/test/org/codehaus/groovy/classgen/asm/sc/BugsStaticCompileTest.groovy
+++ b/src/test/org/codehaus/groovy/classgen/asm/sc/BugsStaticCompileTest.groovy
@@ -1448,19 +1448,21 @@ println someInt
     }
 
     // GROOVY-7784
-    void testWithSamAndEmptyVarArgs() {
+    void testWithSamAndVarArgs() {
         assertScript '''
             class Foo {
-                static foo(Integer x, Iterable y, String... z) { y.join('-') }
+                static foo(Integer x, Iterable y, String... z) { [*y.toList(), 
*z].join('-') }
             }
 
             class Groovy7784 {
-                static emptyVarArgs() {
-                    Foo.foo(42, { ['foo', 'bar'].iterator() })
-                }
+                static emptyVarArgs() { Foo.foo(42, { ['foo', 
'bar'].iterator() }) }
+                static singleVarArgs() { Foo.foo(42, { ['foo', 
'bar'].iterator() }, 'baz') }
+                static multiVarArgs() { Foo.foo(42, { ['foo', 
'bar'].iterator() }, 'baz1', 'baz2') }
             }
 
             assert Groovy7784.emptyVarArgs() == 'foo-bar'
+            assert Groovy7784.singleVarArgs() == 'foo-bar-baz'
+            assert Groovy7784.multiVarArgs() == 'foo-bar-baz1-baz2'
         '''
     }
 }

Reply via email to