Swift3: Converting a swift class marked @objc(ClassName) to swift 2.3 or 3.0 sometimes omits the @objc incorrectly

Originator:KevinRLundberg
Number:rdar://26878535 Date Originated:6/18/2016
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.0 beta 1
Classification:Other Bug Reproducible:Always
 
Summary:
If you have a swift class that subclasses a class written in objc, defined in another module, when you convert your swift code to 2.3 or 3.0, the converter will incorrectly remove @objc while leaving the (ClassName) behind, when it should leave that whole annotation alone. 

I'm not certain if the objc class needs to be in another framework/module for this to happen, but it's the scenario that I ran into and it's the scenario I've reproduced with the attached project.

Steps to Reproduce:
1. Open attached project (created with Xcode 7.3.1) in Xcode 8 beta 1
2. Choose to convert to swift 2.3 or 3.0 when the dialog prompts you to.
3. Let the converter do its work, and note the only change it tries to make in ViewController.swift, which is to change
        @objc(MySubclassFoo)
        class MySubclass: MyClass {}
    to
        (MySubclassFoo)
        class MySubclass: MyClass {}

Expected Results:
No modification should be made to the @objc annotation on the MySubclass swift class

Actual Results:
"@objc" was removed from the annotation, leaving behind (MySubclassFoo)

Regression:
To my knowledge this did not happen when converting to swift 2.2 from an earlier version.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!