[SR-8697] Xcode 10 missing type specifier when converting Swift to objc #51210
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
PrintAsClang
Area → compiler: The PrintAsClang library
Environment
Xcode 10 beta 6, using Swift 4
Additional Detail from JIRA
md5: 0da0e6bcb053aec2d0b1777c1971af56
Issue Description:
Apologies in advance if this doesn't belong here, but I wanted to create the issue just in case. I also added the 'Tooling' flag to this but i presume that's wrong.
When creating a Swift class with a function annotated with @objc, and that function receives as a parameter a generic associated type that will translate into an objc primitive, the conversion in the *-Swift.h file has nullability specifiers that prevent it from compiling.
Steps to Reproduce:
Given the following setup:
When we create a class that exposes an @objc convenience initializer like:
The generated *-Swift.h file contains the following method signature:
Which obviously doesn't compile because it's missing the type specifier:
and that won't compile either because you can't apply _Nonnull to a primitive type.
Expected Results: The method will be translated to objc successfully (in this case it would be something like:
Actual Results:
The generated *-Swift.h file contains the following method signature:
The text was updated successfully, but these errors were encountered: