ajwang / groovypptest

Automatically exported from code.google.com/p/groovypptest
0 stars 0 forks source link

String array initialization error #397

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. typed in this simple Java source code in a new groovyConsole window:
String[] myStringArray1 = {"Java", "is", "Cool"}; 
String[] myStringArray2 = new String[] {"Java", "is", "Cool"}; 
2.run it

What is the expected output? What do you see instead?
should give no error at all

What version of the product are you using? On what operating system?
Ubuntu 11.10 AMD64 + Java 7 x64 + Groovy++ 0.4.300 w/groovy 1.8.0

Please provide any additional information below.
the output:

groovy>  String[] myStringArray = new String[] {"Java", "is", "Cool"};  

1 compilation error:

unexpected token: Java at line: 1, column: 41

groovy> String[] myStringArray1 = {"Java", "is", "Cool"};  
groovy> String[] myStringArray2 = new String[] {"Java", "is", "Cool"};  

1 compilation error:

unexpected token: Java at line: 1, column: 28

Original issue reported on code.google.com by wkw...@gmail.com on 27 Aug 2011 at 7:11

GoogleCodeExporter commented 8 years ago
I believe it does not work in pure groovy as well

Original comment by alex.tka...@gmail.com on 27 Aug 2011 at 7:40