Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: X10 2.2
-
Fix Version/s: X10 2.3.2
-
Component/s: X10 Compiler: Front-end, X10 Compiler: Front-end Typechecking
-
Labels:None
-
Number of attachments :
Description
A "return" statement in an "at" expression should not be interpreted as the value being computed, but as a return from the enclosing method, and treated accordingly. The code below compiles and runs, while it should produce an error in the body of "at" (because no value is computed).
class XTENLANG_2823 {
static def foo():Int {
return at (here.next()) {
return 0;
};
}
public static def main(Array[String]):void {
Console.OUT.println(foo());
}
}
Issue Links
- is depended upon by
-
XTENLANG-2971
Umbrella language/front-end JIRA for X10 2.4
-
The problem arises from parsing the body of the at as a closure body. Instead, we should have a separate production, and create the expression or block directly, not via the closure body rules.