| Summary: | Cast missing on generated FOR statement when TO expression type does not match the index type | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Paul Harmon <pharmon> |
| Component: | EDT | Assignee: | Project Inbox <edt.javagen-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jeffdouglas |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
fixed verified fix |
The following EGL code produces Java that does not compile: program pgm2 type BasicProgram {} myfloat float; index int; function main() for (index from myfloat to 10 by myFloat) end end end The generated java for the FOR looks like this: for (index = myfloat; index <= (short) 10; index += myfloat) { Notice that myfloat is not cast to int before the assignment. Even worse things happen when i change the EGL code to the following program pgm2 type BasicProgram {} myfloat int; index int; function main() for (index from 1.0 to 10.0 by 2) end end end I have not tested this with JS gen. Please route this bug to JSGen when Java is fixed to see if the scenerios work there.