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-12407] Calling .toggle on a wrapped boolean no longer calls didSet #54845

Closed
drewcrawford opened this issue Mar 25, 2020 · 0 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself property wrappers Feature: property wrappers type checker Area → compiler: Semantic analysis

Comments

@drewcrawford
Copy link
Contributor

Previous ID SR-12407
Radar None
Original Reporter @drewcrawford
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, PropertyWrappers, TypeChecker
Assignee None
Priority Medium

md5: 9eba98ce07c54c0c602d9fc610fe2618

duplicates:

  • SR-12089 Swift 5.2 snapshot: didSet not called

Issue Description:

This is a regression in Swift 5.2.

@propertyWrapper
struct B<Type> {
    var wrappedValue: Type
}

struct S {
    @B
    var b: Bool = false {
        didSet {
            print("here")
        }
    }
}

var s = S()
s.b.toggle()

Expected: prints "here"
Actual: no print

Xcode Version 11.4 (11E146)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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 A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself property wrappers Feature: property wrappers type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

1 participant