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-3734] Mangling variadicity of function parameters #46319

Closed
ematejska mannequin opened this issue Jan 25, 2017 · 3 comments
Closed

[SR-3734] Mangling variadicity of function parameters #46319

ematejska mannequin opened this issue Jan 25, 2017 · 3 comments
Labels
affects ABI Flag: Affects ABI task

Comments

@ematejska
Copy link
Mannequin

ematejska mannequin commented Jan 25, 2017

Previous ID SR-3734
Radar rdar://problem/31411197
Original Reporter @ematejska
Type Task
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s
Labels Task, AffectsABI
Assignee None
Priority Medium

md5: aa7ae25b44fc094a36a956e624b0a24e

relates to:

  • SR-4058 Compiler crashes if overloaded method signature contains varargs followed by a second parameter

Issue Description:

Ahead of ABI stability, consider if we need to more carefully mangle variadicity of function parameters.

@swift-ci
Copy link
Contributor

Comment by Pawel Szot (JIRA)

There is a bug related to this: SR-4058

Variadicity marker is only applied if the last parameter is variadic. So these functions have the same mangled name:

func xxx(f1: [Int], bar: Int) { }
func xxx(f1: Int..., bar: Int) { }

Additionaly, after a bit of investigation I have found that variadicity is marked for whole tuple, therefore these two functions would also have the same name if I tried to fix current mangling logic:

func xxx(f1: [Int],  f2: Int..., bar: Int) { }
func xxx(f1: Int...,  f2: [Int], bar: Int) { }

Perhaps variadicity should be reduced to syntatic sugar, so that func foo(a : Int...) is always of type ([Int]) -> (), and users can call it with array.

@bob-wilson
Copy link
Contributor

@swift-ci create

@bob-wilson
Copy link
Contributor

This was fixed in the new mangling scheme in Swift 4.

@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
affects ABI Flag: Affects ABI task
Projects
None yet
Development

No branches or pull requests

2 participants