Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: X10 2.1.2
-
Fix Version/s: X10 2.3.2
-
Labels:None
-
Number of attachments :
Description
When I compile x10/io/Marshal.x10 with expression flattening enabled, I get six errors of which the following is typical:
[ejc] ----------
[ejc] 1. ERROR in /Users/alpern/x10/x10.runtime/src-java/gen/x10/io/Marshal.java (at line 223)
[ejc] CharMarshal<java.lang.String, T> t5938 =
[ejc] ^
[ejc] Cannot make a static reference to the non-static type T
[ejc] ----------
Lines 219 to 236 of /Users/alpern/x10/x10.runtime/src-java/gen/x10/io/Marshal.java are:
//#line 49 final x10. io. Marshal. CharMarshal<java.lang.String, T> t184 = ((x10. io. Marshal. CharMarshal)(x10. io. Marshal.CHAR)); //#line 49 final char t185 = t184.read(((x10. io. Reader)(r)));
The corresponding (unflattened) code in x10/runtime/src/java/gen/x10/io/Marshal.java is:
//#line 49
ch = x10.
io.
Marshal.CHAR.read(((x10.
io.
Reader)(r)));
I think the type of t184 should be x10.io.Marshal.CharMarshal rather than x10.io.Marshal.CharMarshal<java.lang.String, T>.
I checked in a version of the expression flattener with a work around for this bug in the form of a static final boolean called XTENLANG_2055. To reproduce this the bug, set this constant to false;