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-8235] Function with tuple parameter is printed incorrectly #50767

Closed
jepers opened this issue Jul 11, 2018 · 6 comments
Closed

[SR-8235] Function with tuple parameter is printed incorrectly #50767

jepers opened this issue Jul 11, 2018 · 6 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself runtime The Swift Runtime

Comments

@jepers
Copy link

jepers commented Jul 11, 2018

Previous ID SR-8235
Radar rdar://problem/42134697
Original Reporter @jepers
Type Bug
Status Closed
Resolution Done
Environment

Xcode 9.4, Xcode 10 betas and recent dev snapshot

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Runtime
Assignee @slavapestov
Priority Medium

md5: 65a8dc689e6bb2ce5345b941eeb2c5a8

Issue Description:

func g(_ x: Int, _ y: Int) {}
func h(_ tuple: (Int, Int)) {}

print("Type of g:", type(of: g)) // (Int, Int) -> ()
print("Type of h:", type(of: h)) // (Int, Int) -> ()
// Note that the type of h is printed incorrectly, it
// should be: ((Int, Int)) -> ()

// The types are different however:
print("Type of g == Type of h:", type(of: g) == type(of: h)) // false
@belkadan
Copy link
Contributor

@xedin, we have a Radar for this, right?

@xedin
Copy link
Member

xedin commented Jul 12, 2018

I'm not actually sure that we do, at least I couldn't find any...

@xedin
Copy link
Member

xedin commented Jul 12, 2018

@swift-ci create

@xedin
Copy link
Member

xedin commented Jul 12, 2018

Interestingly metatype is printed correctly as `(((Int, Int)) -> ()).Type`

@jepers
Copy link
Author

jepers commented Dec 9, 2018

Issue remains in recent dev snapshot, Swift 5.

@slavapestov
Copy link
Member

#21156

@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 runtime The Swift Runtime
Projects
None yet
Development

No branches or pull requests

4 participants