Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9917] Infinite for-in loop #52323

Closed
swift-ci opened this issue Feb 13, 2019 · 2 comments
Closed

[SR-9917] Infinite for-in loop #52323

swift-ci opened this issue Feb 13, 2019 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-9917
Radar None
Original Reporter dalong (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Swift 4.2

Xcode 10.1

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 98fa264dc4b6bea24bc5ee861c585ddd

duplicates:

Issue Description:

In Swift 4.2, I did execute the code below.

let list: NSMutableArray = ["a", "b", "c"]
for item: Any? in list {
    print(item)
}

Unlike Swift native array, [String], It falls into an infinite loop.

@swift-ci
Copy link
Collaborator Author

Comment by Taehoon (JIRA)

I wonder why this is.
And if possible, can you tell me where the code for the for-in syntax is?

@belkadan
Copy link
Contributor

I'm not sure there's a good answer to that question; it's kind of spread out over the different stages of the compiler. The most relevant part is probably visitForEachStmt in Sema.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants