Subclassing Swift class in test target causes module to be not found

Originator:dpassage
Number:rdar://19245651 Date Originated:12/14/2014
Status:Open Resolved:
Product:Developer Tools Product Version:6.1.1
Classification: Reproducible:Always
 
Project referenced available at https://github.com/dpassage/SubclassTest

Summary:
I have an app written in a mix of Objective-C and Swift, and some test written in both Objective-C and Swift. For testing purposes, I want to subclass some of the classes in the main target in my testing target.

If I create a Swift subclass of an Objective-C class, everything's fine. If I create a Swift subclass of a Swift class, I then start to see an error when compiling the Objective-C test:

In file included from /Users/dpassage/tmp/SubclassTest/SubclassTestTests/SubclassTestTests.m:12:
/Users/dpassage/Library/Developer/Xcode/DerivedData/SubclassTest-dkjavthdjraroyfizogmnafydzkw/Build/Intermediates/SubclassTest.build/Debug-iphonesimulator/SubclassTestTests.build/DerivedSources/SubclassTestTests-Swift.h:67:9: fatal error: module 'SubclassTest' not found
@import SubclassTest;
 ~~~~~~~^~~~~~~~~~~~
1 error generated.

Steps to Reproduce:
Environment: Original 15" Retina Macbook Pro running Yosemite 10.10.1. Bug reproduced using both Xcode 6.1.1 and 6.2 beta 2 (6C95a).

1. Open the attached project. Build and run the tests with command-U. You should see it build and run the tests with no errors.
2. Select the file "FakeRatchet.swift" in the SubclassTestTests group. Check the box under Target Membership to add it to the SubclassTestTests target.
3. Try to build and run the tests again. You should see the error above.

Expected Results:
Project to either compile and run the tests successfully, or report a comprehensible error I can address.

Actual Results:
Xcode reports the compilation error included in the description.

Version:
OS X Yosemite 10.10.1 from the app store (not a GM seed).

Error seen with Xcode both Version 6.2 (6C95a) (beta 2) and Version 6.1.1 (6A2006)

Notes:


Configuration:


Attachments:
'SubclassTest.tgz' was successfully uploaded.

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!