Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.0.2
-
None
-
Windows 7 64bits, JDK 1.7.0_04
Description
Assume we have this method:
static void printMsgs(String ... msgs) { for(String s : msgs) { println s;} }
Calling it from @CompileStatic:
@CompileStatic static void testCS() { //Print: // H // e // l // l // o printMsgs("Hello"); }
The string 'hello' is converted to array of strings.
Calling it from non CompileStatic works fines.
The complete test case:
public class CompileStaticVarArg { static void main(String[] args) { test(); println '-' * 20 testCS() } static void test() { // Print 'hello' printMsgs("Hello"); } @CompileStatic static void testCS() { //Print: // H // e // l // l // o printMsgs("Hello"); } static void printMsgs(String ... msgs) { for(String s : msgs) { println s; } } }