Open swift-ci opened 6 years ago
Very strange! Thanks, Stephen.
@swift-ci create
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.
Attachment: Download
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, ClangImporter | |Assignee | None | |Priority | Medium | md5: f61cc860be9ec93c3135bcfbdc3f0f1cIssue 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