|
8 | 8 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix BONUS |
9 | 9 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix INHERIT |
10 | 10 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix LOCAL |
| 11 | +// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix OVERRIDE |
11 | 12 |
|
12 | 13 | // RUN: %target-swift-symbolgraph-extract -module-name RemoteInheritedDocs -I %t -pretty-print -output-dir %t -skip-inherited-docs |
13 | 14 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix SOME |
14 | 15 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix OTHER |
15 | 16 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix BONUS |
16 | 17 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix SKIP |
17 | 18 | // RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix LOCAL |
| 19 | +// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix OVERRIDE |
18 | 20 |
|
19 | 21 | // SOME: "source": "s:19RemoteInheritedDocs1SV8someFuncyyF" |
20 | 22 | // SOME-NEXT: "target": "s:19RemoteInheritedDocs1SV" |
|
39 | 41 |
|
40 | 42 | // LOCAL: Local docs override! |
41 | 43 |
|
| 44 | +// OVERRIDE-NOT: Extra default docs! |
| 45 | +// OVERRIDE-NOT: Extension override! |
| 46 | + |
42 | 47 | import RemoteP |
43 | 48 |
|
44 | 49 | // The `RemoteP.P` protocol has three methods: `someFunc` and `bonusFunc` don't have docs upstream, |
45 | 50 | // but `otherFunc` does. Regardless, each one needs a `sourceOrigin` field connecting it to |
46 | 51 | // upstream. |
47 | 52 |
|
| 53 | +// `RemoteP.P` also has an extension with a default implementation for `extraFunc` that does have |
| 54 | +// docs, but overriding it here should prevent those from appearing |
| 55 | + |
48 | 56 | public struct S: P { |
49 | 57 | public func someFunc() {} |
50 | 58 |
|
51 | 59 | public func otherFunc() {} |
52 | 60 |
|
53 | 61 | /// Local docs override! |
54 | 62 | public func bonusFunc() {} |
| 63 | + |
| 64 | + public func extraFunc() {} |
| 65 | +} |
| 66 | + |
| 67 | +public extension P { |
| 68 | + /// Extension override! |
| 69 | + func someFunc() {} |
55 | 70 | } |
56 | 71 |
|
0 commit comments