Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316691

Summary: For-loop i variable index not working
Product: [Modeling] Acceleo Reporter: brandon8863
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description brandon8863 CLA 2010-06-12 18:56:30 EDT
From the new and noteworthy page:

Acceleo [for] blocks now declare an implicit ā€œiā€ variable that can be used to retrieve the iteration count. For example, [for (Sequence{4, 5, 6})][i/], [/for] will generate 1, 2, 3.

the [i/] variable gives an error in the editor and does not work during generation.
Comment 1 brandon8863 CLA 2010-06-12 19:09:28 EDT
Resolution:

Within the same .mtl file there was 2 different templates defined. In the template that was not in the one where I was attempting to use the i index variable was a for loop that had i as the local iterator variable. When I changed that variable to item instead of i the editor and generation started working correctly.

Lessons Learned:
Do not use 'i' as iterator variable name in any for loops.
Comment 2 Laurent Goubet CLA 2011-08-18 04:21:52 EDT
Closing our "resolved" and "verified" bugs.