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-1350] REPL doesn't correctly handle guard variable shadowing #4524

Open
swift-ci opened this issue Apr 28, 2016 · 1 comment
Open

[SR-1350] REPL doesn't correctly handle guard variable shadowing #4524

swift-ci opened this issue Apr 28, 2016 · 1 comment
Labels
bug Something isn't working LLDB for Swift REPL

Comments

@swift-ci
Copy link

Previous ID SR-1350
Radar None
Original Reporter jaybuff (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug, REPL
Assignee None
Priority Medium

md5: 3866fdf30f82bf574e50d9a237eeb02f

Issue Description:

let hex = "DEADBEEF"
let num = Int(hex, radix: 16)
guard let num = num else {
    fatalError("Couldn't parse \(hex) as an integer")
}

pasting the above program into the REPL, then adding print(num) prints Optional(3735928559). When I compile and run it, I get 3735928559.

@belkadan
Copy link

Per comments in SR-1353 it's not quite clear what the correct behavior is in the compiler, but the REPL has generally always allowed you to replace a binding.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift REPL
Projects
None yet
Development

No branches or pull requests

2 participants