Commit 80a988e
committed
[CSGen] forcing an optional should prefer subtyping only if it's applied to a member
`TVO_PrefersSubtypeBinding` in this case is intended to support
references to Objective-C imported members that can be force
unwrapped before being used i.e. accessing an overloaded method
on `AnyObject` should always prefer an overload that returns
a subtype:
```
@objc class A: NSObject {
@objc func test() -> A { }
@objc func test() -> B { }
}
func test(obj: AnyObject) {
obj.test!()
}
```
where `B` is a subtype of `A` should result in selection of
`() -> B`.1 parent a892e57 commit 80a988e
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2797 | 2797 | | |
2798 | 2798 | | |
2799 | 2799 | | |
2800 | | - | |
2801 | | - | |
2802 | | - | |
2803 | | - | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
2804 | 2806 | | |
2805 | 2807 | | |
2806 | 2808 | | |
| |||
0 commit comments