Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: X10 SVN HEAD
-
Fix Version/s: X10 2.3.2
-
Component/s: Language Design
-
Labels:None
-
Number of attachments :
Description
I recently accidently captured 'this' while using a field inside an at block without realising that it was a field and not just a local variable in scope. This can really cripple performance and take a while to track down.
Given that we don't have tools to help with this problem, and it is a very easy mistake to make, why don't we just force programmers to capture 'this' explicitly in the rare case that this what they want? It would make it much easier to approximate the cost of an 'at' by reading code.
The extra strictness could be disabled with an annotation on the 'at' if desired.
Issue Links
- is depended upon by
-
XTENLANG-2971
Umbrella language/front-end JIRA for X10 2.3.1
-
- relates to
-
XTENLANG-2466
Capturing a field (instead of capturing the entire container): implication on "this" escaping
-
-
XTENLANG-1913
Copying semantics: copying 'at' should not copy 'this'
-
Bard points out that this problem may be greatly reduced by extended 'at' syntax proposed for 2.3