XCTestCase testRunClass should be of type XCTestRun.Type in Swift
| Originator: | B.Gesiak | ||
| Number: | rdar://25568830 | Date Originated: | 05-Apr-2016 10:19 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | |
| Classification: | Enhancement | Reproducible: | Always |
Summary:
See: https://github.com/apple/swift-corelibs-xctest/pull/86#discussion_r58315662
XCTest defines {{XCTestCase.testRunClass}} as an {{AnyClass?}}, and checks at runtime that this is a subclass of {{XCTestRun}}. It would be nicer if this was exported as {{XCTestRun.Type}} or {{XCTestRun.Type?}}.
Steps to Reproduce:
{{import XCTest}} from within a Swift file, check the type of {{XCTestCase.testRunClass}}.
Expected Results:
Has a type that conveys the expectations of the value: that it is an {{XCTestRun.Type}} or {{XCTestRun.Type?}}.
Actual Results:
It has a type of {{AnyClass?}}, meaning the type system would not prevent me from returning an {{NSCalendar}} from this method.
Regression:
All versions of XCTest.
Notes:
Provide additional information, such as references to related problems, workarounds and relevant attachments.
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!