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-1324] Passing a parameter of type protocol P to a generic method with a protocol P constraint fails #43932

Closed
stuartcarnie opened this issue Apr 26, 2016 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@stuartcarnie
Copy link

Previous ID SR-1324
Radar None
Original Reporter @stuartcarnie
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

OS X 10.11.5 Beta 2

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

md5: 4be481df59ed0f10559f54551d870724

duplicates:

  • SR-55 non-@objc protocol existentials do not conform to their own protocol type

Issue Description:

Per the attached Swift file, line 21 will result in a compiler error attempting to call testP with a parameter of type protocol P. Naturally the parameter conforms to P. I tested against 0425 SNAPSHOT and it did not pass.

@belkadan
Copy link
Contributor

It is actually not generally the case that a value of type P can be used with a generic parameter constrained by P—for example, if P has static requirements.

@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

2 participants