Skip to content

[SR-6811] Properties in ObjC protocol to Swift 4 #49360

@swift-ci

Description

@swift-ci
Previous ID SR-6811
Radar rdar://problem/50319752
Original Reporter marco (JIRA User)
Type Bug

Attachment: Download

Environment

Xcode Version 9.2 beta (9C34b)

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

md5: ac75ea24f10428a371bce7f5da5a12b8

Issue Description:

If ProtocolA defines a property of type NSObject<ProtocolB>*, the Swift interface shows the property with type ProtocolB rather than NSObject & ProtocolB.

If the property is of type NSString<ProtocolB>*, the Swift interface loses the protocol information and just converts the property to type String.

What am I missing? It looks like the Swift conversion either loses the class or protocol information rather than keep them both with '&'.

I've attached an example project that shows the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions