Skip to content

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

Open
@swift-ci

Description

@swift-ci
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions