Not working Swift 3 code example
| Originator: | konstantin.koval1 | ||
| Number: | rdar://28385905 | Date Originated: | 20-Sep-2016 04:02 PM |
| Status: | Open | Resolved: | |
| Product: | Documentation | Product Version: | Xcode 8.0 (8A218a) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
The code example from Subclassing section is not compiling in Swift 3
https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html
Now:
```
public class A {
private func someMethod() {}
}
internal class B: A {
override internal func someMethod() {}
}
```
Expected Results:
Class B can’t override private fund since it doesn’t have access to it anymore in Swift 3
Instead the modifier should be change to fileprivate or internal
```
public class A {
fileprivate func someMethod() {}
}
internal class B: A {
override internal func someMethod() {}
}
```
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!