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-6894] An imported convenience initializer that overloads a designated initializer with the same NS_SWIFT_NAME cannot be called #49443

Open
swift-ci opened this issue Feb 1, 2018 · 2 comments
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

swift-ci commented Feb 1, 2018

Previous ID SR-6894
Radar rdar://problem/37160678
Original Reporter stephan (JIRA User)
Type Bug

Attachment: Download

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

md5: f61cc860be9ec93c3135bcfbdc3f0f1c

Issue Description:

In the attached sample project the line `MyClass({builder in })` in ViewController.swift compiles, but `MyClass2({builder in })` does not, although both classes have almost the same interface. The bridged convenience initializer of `MyClass2` doesn't seem to be available

@belkadan
Copy link
Contributor

belkadan commented Feb 2, 2018

Very strange! Thanks, Stephen.

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Stephan Tolksdorf (JIRA)

This bug is caused by recordShadowedDecls in NameLookup.cpp assuming that all Objective-C initializers with the same name shadow each other, which seems to ignore that Objective-C initializers can be overloaded via the swift_name attribute.

@belkadan @DougGregor Do you maybe have a suggestion how best to fix this issue? I wonder why it's possible to 'shadow' initializers at all. I would have expected constructors with identical overload signatures to cause an ambiguity error.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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
Projects
None yet
Development

No branches or pull requests

2 participants