Skip to content

[SR-14884] @available(*, deprecated) does not affect Property Wrapper #57231

Open
@t-ae

Description

@t-ae
Previous ID SR-14884
Radar rdar://problem/80277462
Original Reporter @t-ae
Type Bug
Environment

Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
Target: x86_64-apple-darwin20.5.0

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

md5: ccfb8e611ad9f91b67012c41168c82be

Issue Description:

Swift compiler does not warn accessing to deprecated property wrapper.

In the example below, the expected behavior should be that accessing to $value and _value also be reported.

$ cat main.swift 
import Combine

final class Foo: ObservableObject {
    @available(*, deprecated)
    @Published var value: Int = 0
    
    func bar() {
        print(value)
        print($value)
        print(_value)
    }
}

$ swiftc main.swift 
main.swift:8:15: warning: 'value' is deprecated
        print(value)
              ^

Metadata

Metadata

Assignees

Labels

availabilityThe @available attribute and availability checking in generalbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfproperty wrappersFeature: property wrappersswift 5.4type checkerArea → compiler: Semantic analysis

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions