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-2323] Conflicting scope-private members causes crash #44930

Open
belkadan opened this issue Aug 11, 2016 · 0 comments
Open

[SR-2323] Conflicting scope-private members causes crash #44930

belkadan opened this issue Aug 11, 2016 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@belkadan
Copy link
Contributor

Previous ID SR-2323
Radar None
Original Reporter @belkadan
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 66a49b33ef65b02821b97f9f072c5232

is duplicated by:

  • SR-3557 Incorrect function called when defined in extensions

relates to:

  • SR-2634 Private types collide when in extensions of the same base type in the same file

Issue Description:

struct X {}

extension X {
  private func foo() {}
}
extension X {
  private func foo() {}
}

While this seems like it should be legal, there are two problems:

1. Our mangling scheme doesn't actually give these different symbol names.
2. When debugging, we don't have a good way to pick one over the other.

We could fix these issues, but it seems simpler to just reject this code: within a file, conflicting "overloads" like this should not be allowed despite being declared private. (Note that this isn't limited to extensions and that one of the members might not be private; that's just the simplest way to show the problem.)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
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 crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

2 participants