Cannot override computed class property when classes are defined in different Swift files
| Originator: | josh.hinman | ||
| Number: | rdar://17650954 | Date Originated: | 12-Jul-2014 01:10 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6b3 |
| Classification: | Reproducible: | Always |
Summary:
When two classes, e.g. Foo and Bar, in which one inherits from the other, e.g. Bar: Foo, and in which the two classes are defined in separate .swift files, contain computed class properties that are overridden in the subclass, the subclass's implementation cannot be called without causing a compiler error.
Steps to Reproduce:
1. Load the attached sample project
2. build+run
Expected Results:
The program should output "bar"
Actual Results:
Compiler error:
main.swift:20:9: error: ambiguous use of 's'
println(Bar.s)
^
Bar.swift:12:24: note: found this candidate
override class var s: String! {
^
main.swift:13:15: note: found this candidate
class var s: String! {
^
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!