Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329554 - Issue with i implicit and explicit i counters in for loops
Summary: Issue with i implicit and explicit i counters in for loops
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Linux
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-05 11:04 EDT by Yvan Lussaud CLA
Modified: 2011-04-04 04:21 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yvan Lussaud CLA 2010-11-05 11:04:43 EDT
Writing the following code in a module create an error about i variable not defined :

[for (Sequence{0..4})]
[i/]
[/for]
[for (i : Integer | Sequence{0..4})]
[i/]
[/for]

-----------------------

To fix this do not call a for variable i :

[for (Sequence{0..4})]
[i/]
[/for]
[for (Sequence{0..4})]
[i/]
[/for]

or

[for (Sequence{0..4})]
[i/]
[/for]
[for (j : Integer | Sequence{0..4})]
[j/]
[/for]

regards,
Yvan.
Comment 1 Vlad Gheorghe CLA 2011-04-02 18:38:13 EDT
First, do we agree that this is a real bug ?

May I suggest to change the "i" to something less common, which also states that is an acceleo extension, like 
"acceleoCurrentIteration"
Comment 2 Stephane Begaudeau CLA 2011-04-04 04:21:03 EDT
It is indeed a real bug but we will not change "i" for something else because it would potentially break the compatibility with acceleo module already created.

A patch has been contributed. The "i" variable should not create problems with an iteration variable named "i" anymore. The fix has been contributed on HEAD, it will be available for Acceleo 3.1 M7.

4 unit tests have been contributed to ensure that compilation errors do not re-appear.