[SR-5349] Can not extend Objective-c generics in Swift 4 #47923
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
regression
swift 4.0
Additional Detail from JIRA
md5: 171eee9cedd95064bf9af4b65106217b
Issue Description:
I am using swift 4 running Xcode 9 beta 2.
And the compiler throws a segmentation fault for the following code
update July 4, 2017
There appears to be a workaround for this issue. The seg fault seems to happen if the Objective-c implementation and the swift extension exist in the same module, but it works without an issue if they are in separate ones as described here
Apparently if the Objective-c implementation is moved to a framework (i.e. Abc.framework), we can make a swift extension in a separate framework (i.e. Abc_extensions.framework) where Abc_extensions depends on Abc.framework.
It compiles and we get to add type specific methods.
The text was updated successfully, but these errors were encountered: