Swift: Array extensions have some methods not visible from different targets
| Originator: | marco | ||
| Number: | rdar://17465144 | Date Originated: | 26/06/2014 |
| Status: | Open | Resolved: | |
| Product: | Product Version: | ||
| Classification: | Reproducible: |
Summary:
I created an Array extension, but one of the computed properties I defined is not visible from the test target.
I guess the problem is the return type, which is T!.
This problem doesn't happen in playground:
extension Array {
var head: T! {
if isEmpty {
return nil
}
return self[0]
}
}
[1,2,3].head
works just fine.
Steps to Reproduce:
Open the Xcode project in Xcode 6.
Build should be successful but the test target should fail to compile because of the missing property "head" on Array, which is defined.
As I said, this problem doesn't happen in playground.
Expected Results:
Test target should compile as the computed property has been defined.
Actual Results:
Test target doesn't compile as it can't find the computed property.
Version:
Xcode 6 beta 2
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!