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-11120] [5.1] [property wrapper] attribute lookup does not include typealiases #53516

Closed
swift-ci opened this issue Jul 12, 2019 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11120
Radar rdar://problem/53107788
Original Reporter tannernelson (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

swift-5.1-DEVELOPMENT-SNAPSHOT-2019-07-11-a-osx.pkg
macOS 10.15 Beta
Xcode 11.0 beta 2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @theblixguy
Priority Medium

md5: deb0a1f058605397bf4708d8c6f58bc2

duplicates:

  • SR-11288 Property wrappers aren't inherited as type aliases

relates to:

  • SR-11131 Nested protocolWrappers can't be typealias'ed when parent type is generic

Issue Description:

Assuming the following code:

public protocol Model { }

@propertyWrapper
public struct ModelField<M, V>
    where M: Model, V: Codable
{
    public init() { }
    
    public var wrappedValue: V {
        get { fatalError() }
        set { fatalError() }
    }
}

extension Model {
    public typealias Field<V> = ModelField<Self, V>
        where V: Codable
}

The typealias for `Field` is not respected when looking up attributes:

struct Planet: Model {
    @Field var name: String
}

error: unknown attribute 'Field'
    @Field var name: String
    ^
@belkadan
Copy link
Contributor

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by tanner0101 (JIRA)

Do you think this bug will be fixed in 5.1?

@swift-ci
Copy link
Collaborator Author

Comment by tanner0101 (JIRA)

@belkadan / @DougGregor any updates on this?

@theblixguy
Copy link
Collaborator

Fixed here: #26795

@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
Projects
None yet
Development

No branches or pull requests

3 participants