History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-2743
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Mingfai Ma
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Fail to compile when there is a method return List<int[]>

Created: 11/Apr/08 08:00 PM   Updated: 26/Apr/08 07:57 AM
Component/s: command-line compiler
Affects Version/s: 1.5.4
Fix Version/s: 1.6-beta-1, 1.5.7

Time Tracking:
Not Specified

Environment: JDK 6, Groovy 1.5.4, Grails 1.0.2


 Description  « Hide
For a simple class with a method that return a List<int[]>, i.e.
class Tester{
List<int[]> getList() { return [[0,0] as int[]]; }
}

It cannot compile. the following are error message:
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: illegal start of type
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: ';' expected
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: invalid method declaration; return type required
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: illegal start of expression
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: ';' expected
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: illegal start of expression
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: ';' expected
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
C:\Documents and Settings\USERNAME\.grails\1.0.2\projects\test_grails\generated-java-source\Tester.java:13: not a statement
public java.util.List<[I> getList() { return (java.util.List<[I>)null;}
^
8 errors
Compilation error: Compile failed; see the compiler error output for details.

Notice that it's a Grails application and the compilation is done when i run grails run-app. It seems there is no problem when use IDEA to do unit test against the method.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jochen Theodorou - 13/Apr/08 10:45 AM
looks like we need to check for primitive types before printing