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-9697] REPL displays wrong boolean dictionary values #4346

Closed
martinr448 opened this issue Jan 18, 2019 · 6 comments
Closed

[SR-9697] REPL displays wrong boolean dictionary values #4346

martinr448 opened this issue Jan 18, 2019 · 6 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@martinr448
Copy link

Previous ID SR-9697
Radar None
Original Reporter @martinr448
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: b89d33183decc6bd01384d5aad3702c8

Issue Description:

(From https://forums.swift.org/t/repl-prints-wrong-dictionary-values/19588.) A dictionary with boolean values is displayed wrongly in the REPL, here the value is displayed as `false` instead of `true`:

Welcome to Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1). Type :help for assistance.
  1> let dict = ["foo" : true]
dict: [String : Bool] = 1 key/value pair {
  [0] = {
    key = "foo"
    value = false
  }
}
  2> dict
$R0: [String : Bool] = 1 key/value pair {
  [0] = {
    key = "foo"
    value = false
  }
}

`print()` shows the correct value, also accessing the value via subscript:

  3> print(dict)
["foo": true]
  4> dict["foo"]!
$R1: Bool = true

Tested with Swift 4.2.1 (Xcode 10.1) on macOS, and swift-4.2.1-RELEASE-ubuntu18.04 on Linux.

@swift-ci
Copy link

Comment by Robert Collins (JIRA)

this is my puppy: https://stackoverflow.com/questions/54239569/dict-value-in-struct-is-ignored-for-bool?noredirect=1

🙂 I'm just attaching a comment here so I can keep track of progress

@benrimmington
Copy link

This appears to be fixed in a recent Swift 5.0 snapshot.

Although I don't know how or when it was fixed.

e.g. Bool_SummaryProvider in SwiftFormatters.cpp hasn't changed.

@belkadan
Copy link

I remember it being fixed but I can't find the bug for it. It was a problem with Dictionary, not Bool. jingham@apple.com (JIRA User)?

@swift-ci
Copy link

Comment by Jim Ingham (JIRA)

IIRC this was just a Radar, and @dcci fixed it. I looked briefly for the radar but couldn't find it, maybe Davide remembers better.

@dcci
Copy link
Mannequin

dcci mannequin commented Jan 18, 2019

Dictionary formatters changed quite a bit, and I also fixed a bug to take in account the padding (which might have fixed this).
Please try with top of tree. Thanks!

@martinr448
Copy link
Author

Works correctly with development snapshot from January 16, 2019.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 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 Something isn't working LLDB for Swift
Projects
None yet
Development

No branches or pull requests

4 participants