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

Comments

@stuartcarnie
Copy link

@stuartcarnie stuartcarnie commented Apr 26, 2016

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

@belkadan belkadan commented Apr 28, 2016

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

No branches or pull requests

2 participants