Infinite loop in Swift with range 3..0
| Originator: | richardb | ||
| Number: | rdar://17209711 | Date Originated: | 2014-06-07 |
| Status: | Duplicate of 16254937 (Open) | Resolved: | |
| Product: | Swift | Product Version: | |
| Classification: | Crash | Reproducible: | Always |
Summary:
`for i in 3..0` loops infinitely instead of exiting immediately
Steps to Reproduce:
Open the attached playground file [not attached in Open Radar], which contains:
var x = 0
for i in 3..0 {
println(i)
x = i
}
x
Expected Results:
The "for" loop does not run its body at all. x remains at 0
Actual Results:
The "for" loop runs infinitely and never exits.
Version:
Xcode 6 build 6A215l
Os X 10.9.3 build 13D65
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!