Swift: Stored property with didSet observer needs explicit type
| Originator: | dieter.komendera | ||
| Number: | rdar://18703195 | Date Originated: | 19-Oct-2014 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 6.1 (6A1046a) |
| Classification: | Bug | Reproducible: | Always |
Summary:
I would expect this to work, as the type of data can be inferred:
class DataViewController {
var data = [Int]() {
didSet {
println(data)
}
}
}
Instead this error is shown:
error: computed property must have an explicit type
Steps to Reproduce:
paste the code snipped above into a swift repl
Expected Results:
compiles
Actual Results:
error: computed property must have an explicit type
Version:
Version 6.1 (6A1046a)
Notes:
Configuration:
n/A
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!