Bug 65503 - [1.5] "new" for-loop inside "old" for-loop gives error
Summary: [1.5] "new" for-loop inside "old" for-loop gives error
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-03 05:12 EDT by Michael Mutschler CLA
Modified: 2005-01-11 11:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Mutschler CLA 2004-06-03 05:12:21 EDT
using a new-style for-loop inside a "classic" for loop, produces the following 
error:
"Type mismatch: cannot convert from int to boolean"

here is a code-sample:
    public void bug(List<String> lines) {
        for (int i=0; i<10; i++) {  // here the "i++" is marked bad
            for (String test: lines) {
                System.out.println(test);
            }
        }
    }

PS: using ecplise3.0RC1 & cheetah V0.05
Comment 1 Philipe Mulet CLA 2004-06-17 12:50:08 EDT
Error is due to invalid parse. Outer for statement got parsed into:
   for (int i = 0;; (i ++); )    
Comment 2 Olivier Thomann CLA 2004-06-17 15:15:16 EDT
Fixed and released in stream 1.5.
Regression test added.