Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: X10 SVN HEAD
-
Fix Version/s: X10 2.3.2
-
Labels:None
-
Number of attachments :
Description
Code fragment in question:
public class HeatTransfer_v2 { static val n = 3; static val epsilon = 1.0e-5; static val BigD = Dist.makeBlock([0..n+1, 0..n+1], 0); static val D = BigD | ([1..n, 1..n] as Region); static val LastRow = [0..0, 1..n] as Region; static val A = DistArray.make[Double](BigD,(p:Point)=>{ LastRow.contains(p) ? 1.0 : 0.0 }); static val Temp = DistArray.make[Double](BigD); static def stencil_1((x,y):Point(2)): Double { return ((at(A.dist(x-1,y)) A(x-1,y)) + (at(A.dist(x+1,y)) A(x+1,y)) + (at(A.dist(x,y-1)) A(x,y-1)) + (at(A.dist(x,y+1)) A(x,y+1))) / 4; }
when compiled, yields the following syntax errors
[dgrove@wannalancit tutorial]$ x10c++ HeatTransfer_v2.x10 /home/dgrove/x10-trunk/x10.dist/samples/tutorial/HeatTransfer_v2.x10:28: Syntax error: Token(s) inserted to complete scope: "MethodBody" static val n = 3; ^--------^ /home/dgrove/x10-trunk/x10.dist/samples/tutorial/HeatTransfer_v2.x10:37: Syntax error: Token "=>" expected instead of this input static def stencil_1((x,y):Point(2)): Double { ^
The second error is correct. The first error is completely spurious. If you change (x,y) to [x,y] then the code compiles.
Issue Links
- is duplicated by
-
XTENLANG-2676
Misleading and unhelpful error message when using 'b' as byte literal suffix
-
- relates to
-
XTENLANG-1841
Spurious initial error message when method body doens't parse
-
bulk defer of unresolved 2.1.0 bugs to 2.1.1.