Swift: Subclass in test method cannot acces method's scope without SEGFAULT

Originator:christian.tietze
Number:rdar://21220076 Date Originated:2015-06-03
Status:Closed Resolved:
Product:Developer Tools Product Version:
Classification:Serious Bug Reproducible:Always
 
Summary:
When you create a subclass in a test method (e.g. for mocking an object), overriding a method of this private subclass to access variables from the test case's context is not possible. Compilation fails.

Steps to Reproduce:
1. Add class to override with 1+ methods
2. Add new test suite and empty test case
3. Add variable, e.g. `expectation` to the test case
4. Override class and one of its methods within test case, set the variable from the test case's scope to another value


Expected Results:
The variable (e.g. `expectation`) obtains its new value if the method in question of an instance of the private subclass is invoked.

Actual Results:
Segmentation fault: 11

Version:
Xcode Version 6.3.2 (6D2105)

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!