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-6189] Strange values being printed when using protocols #4383

Open
twostraws opened this issue Oct 19, 2017 · 1 comment
Open

[SR-6189] Strange values being printed when using protocols #4383

twostraws opened this issue Oct 19, 2017 · 1 comment
Labels
bug Something isn't working LLDB for Swift

Comments

@twostraws
Copy link

Previous ID SR-6189
Radar None
Original Reporter @twostraws
Type Bug
Environment

Apple Swift version 4.0.1 (swiftlang-900.0.66 clang-900.0.37)

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

md5: 8871f937a74bcd0b7db112ed85778687

Issue Description:

If you launch Swift on the command line and give it the following code:

protocol Testable {

}

struct TestStruct: Testable {
    var num = 0
    var str = ""
}

let test1 = TestStruct()
let array: [Testable] = [test1]

Then the output you get is as follows:

test1: TestStruct = {
  num = 0
  str = ""
}
array: [Testable] = 1 value {
  [0] = {
    num = 4300275808
    str = ""
  }
}

The "4300275808" is clearly wrong. If you change the code to be [TestStruct] rather than [Testable] then the problem goes away.

@belkadan
Copy link

jingham@apple.com (JIRA User), sound familiar?

@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
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

2 participants