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-11067] Property Wrappers and private breaks #53459

Open
swift-ci opened this issue Jul 4, 2019 · 2 comments
Open

[SR-11067] Property Wrappers and private breaks #53459

swift-ci opened this issue Jul 4, 2019 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software property wrappers Feature: property wrappers

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jul 4, 2019

Previous ID SR-11067
Radar None
Original Reporter chriseidhof (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, PropertyWrappers
Assignee None
Priority Medium

md5: 8bbcb160b8cab5f0d8c7b0f7cbaffb3d

Issue Description:

Here's a minimal example that segfaults:

@propertyWrapper class KeychainItem {
    var wrappedValue: String? = nil
}

struct ContentView : View {
    @KeychainItem private var item: String?
    var body: some View {
        Text("Hello World")
    }
}

Removing the private modifier makes the code compile again.

BTW, the diagnostics for the segfault didn't point to this location. It took quite some time to find the culprit.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jul 4, 2019

Comment by Chris Eidhof (JIRA)

Here's a similar bug, without the private modifier (but using a class):

@propertyWrapper class KeychainItem {
    var wrappedValue: String? = nil
}

class Session {
    @KeychainItem var sid: String?
}

struct ContentView : View {
    let session = Session()
    var body: some View {
        Text("Hello World")
    }
}

If we change Session to be a struct it compiles fine...

@belkadan
Copy link
Contributor

belkadan commented Jul 6, 2019

The first one's fixed in master and the 5.1 branch. The second one doesn't seem to be crashing for me?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
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. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software property wrappers Feature: property wrappers
Projects
None yet
Development

No branches or pull requests

3 participants