Skip to content

nonisolated applied to @propertyWrapper-wrapped property does not propagate to projectedValue in deinit #59380

@b8591340

Description

@b8591340
import Foundation

@propertyWrapper struct Wrapper {
    var   wrappedValue: Int { .zero }
    var projectedValue: Int { .max }
}

@MainActor
class Sample {
    @Wrapper nonisolated var value

    deinit {
        print (value)
        print($value)
    }
}
error: property '$value' isolated to global actor 'MainActor' can not be referenced from this synchronous context
        print($value)
              ^`

Starting from Swift 5.7 (Xcode 14 beta 1), only with -Xfrontend -warn-concurrency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresproperty wrappersFeature: property wrappers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions