swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.49k stars 10.35k forks source link

[SR-14797] Typealiases defined in protocols cannot be used as property wrappers #57146

Open matt-curtis opened 3 years ago

matt-curtis commented 3 years ago
Previous ID SR-14797
Radar rdar://problem/79563721
Original Reporter @matt-curtis
Type Bug
Environment Swift 5.5
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 6820bee8f850c8066494428a3379417c

Issue Description:

Here's some sample code that shows an instance where this issue appears:

@propertyWrapper
struct PropertyWrapper<Wrapped> { var wrappedValue: Wrapped }

protocol SomeProtocol {

    typealias SpecializedPropertyWrapper<Wrapped> = PropertyWrapper<Wrapped>

}

struct SomeConformingType: SomeProtocol { }

struct AStruct {

    @SomeConformingType.SpecializedPropertyWrapper var string: String // unknown attribute 'SomeConformingType.SpecializedPropertyWrapper'

}

There's also a discussion on the Swift forums spawned by this issue.

typesanitizer commented 3 years ago

@swift-ci create