Repository: groovy
Updated Branches:
  refs/heads/master aa0e7b786 -> 2aa3bc1ce


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/2aa3bc1c
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/2aa3bc1c
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/2aa3bc1c

Branch: refs/heads/master
Commit: 2aa3bc1ce0b4d8737babc55aaf77e9ed2bd0c9c6
Parents: aa0e7b7
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:46:51 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/2aa3bc1c/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