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-6263] Inconsistent assignability of tuple & functional types #48813

Closed
swift-ci opened this issue Oct 31, 2017 · 3 comments
Closed

[SR-6263] Inconsistent assignability of tuple & functional types #48813

swift-ci opened this issue Oct 31, 2017 · 3 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-6263
Radar rdar://problem/35369202
Original Reporter Max Medvedev (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @xedin
Priority Medium

md5: ffe8d2a8000f1d1fc5a93d34e61b3f07

duplicates:

  • SR-2672 Implement tuple conversion

Issue Description:

For some reason a tuple of subclasses is not a tuple of superclasses. But a function taking a tuple of superclasses is a function taking a tuple of subclasses. Something is wrong or at least weird here =)

class B {}
class C: B {}

var f1: ((B, B)) -> () = {p in }
var f2: ((C, C)) -> () = f1 //note: compiler allows this assignment

var v: (C, C) = (C(), C())

//at this point f1 & f2 are effectively the same instance
//but compiler doesn't allow to invoke f1 with v arg

f1(v) //Cannot express tuple conversion '(C, C)' to '(B, B)'
f2(v)
@belkadan
Copy link
Contributor

belkadan commented Nov 1, 2017

@xedin, do you have the dup for this?

@xedin
Copy link
Member

xedin commented Nov 6, 2017

@belkadan I don't think so, but I will take a look.

@xedin
Copy link
Member

xedin commented Nov 6, 2017

@swift-ci create

@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