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-10069] Local functions cannot be overloaded #52471

swift-ci opened this issue Mar 9, 2019 · 4 comments

[SR-10069] Local functions cannot be overloaded #52471

swift-ci opened this issue Mar 9, 2019 · 4 comments


Copy link

@swift-ci swift-ci commented Mar 9, 2019

Previous ID SR-10069
Radar rdar://problem/29312676
Original Reporter Jessy (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download


Xcode 10.2 beta 2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: a3e401e1593c9e4c9bddb38188f91607

is duplicated by:

  • SR-13306 Incorrect shadowing behavior for local functions and outer function parameters

Issue Description:

These don't compile:

  1. Nested overloads with different parameter types.

  2. Calling a nested function before an overload is defined later in the function.

Copy link

@belkadan belkadan commented Mar 15, 2019

func ƒ() {
func nested(_: Bool) { }
func nested(_: Int) { }

func ƒ2() {
func nested(bool _: Bool) { }

nested(bool: false)

func nested(int _: Int) { }

Copy link

@belkadan belkadan commented Mar 15, 2019

I'm not sure if there was an explicit discussion against allowing nested overloads by type. The second example certainly seems like a bug to me, though.

cc @DougGregor, @xedin, davidungar (JIRA User)

Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 15, 2019

Comment by David Ungar (JIRA)

Thanks, @belkadan for the heads-up. Thanks Jessy (JIRA User).

Copy link

@slavapestov slavapestov commented Oct 9, 2020

@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
None yet

No branches or pull requests

3 participants