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-2580] Call to a generic function that expects argument to conform a protocol fails if argument compose multiple protocols. #45185

Closed
swift-ci opened this issue Sep 8, 2016 · 0 comments

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Sep 8, 2016

Previous ID SR-2580
Radar None
Original Reporter nikita (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: 529ab262cc74a0bad21200ae117b0f2a

duplicates:

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

Issue Description:

Following code cause a error — Cannot invoke `foo` with an argument list of type `(bar: A & B)`:

protocol A {}
protocol B {}
class C: A, B {}
func foo<T>(bar: T) where T: A {}
let c: A & B = C()
foo(bar: c)

If c defined as following, everything works:

let c: A = C()
@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

1 participant