4
4
// RUN: %target-swift-symbolgraph-extract -module-name InheritedDocs -I %t -pretty-print -output-dir %t
5
5
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes CHECK,DOCS
6
6
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
7
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
8
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS-DOCS
7
9
8
10
// RUN: %target-swift-symbolgraph-extract -module-name InheritedDocs -I %t -pretty-print -output-dir %t -skip-inherited-docs
9
11
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes CHECK,SKIP
10
12
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
13
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
14
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS-SKIP
11
15
12
16
// RUN: %empty-directory(%t)
13
17
// RUN: %target-build-swift %s -module-name InheritedDocs -emit-module -emit-module-path %t/InheritedDocs.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ -skip-inherited-docs
14
18
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes SKIP
15
19
16
20
// DOCS-COUNT-3: Some Function
21
+ // BONUS-DOCS-COUNT-2: Bonus docs!
17
22
// SKIP-COUNT-1: Some Function
23
+ // BONUS-SKIP-COUNT-1: Bonus docs!
24
+
25
+ // synthesized symbols should have a sourceOrigin field that points to where its docs come from
18
26
19
27
// CHECK: "source": "s:13InheritedDocs1PPAAE8someFuncyyF::SYNTHESIZED::s:13InheritedDocs1SV"
20
28
// CHECK-NEXT: "target": "s:13InheritedDocs1SV"
21
29
// CHECK-NEXT: "sourceOrigin"
22
30
// CHECK-NEXT: "identifier": "s:13InheritedDocs1PP8someFuncyyF"
23
31
// CHECK-NEXT: "displayName": "P.someFunc()"
24
32
33
+ // non-synthesized symbols that nonetheless inherit docs (like this extension) should have the same
34
+
25
35
// IMPL: "source": "s:13InheritedDocs1PPAAE8someFuncyyF"
26
36
// IMPL-NEXT: "target": "s:13InheritedDocs1PP8someFuncyyF"
27
37
// IMPL-NEXT: "sourceOrigin"
28
38
// IMPL-NEXT: "identifier": "s:13InheritedDocs1PP8someFuncyyF"
29
39
// IMPL-NEXT: "displayName": "P.someFunc()"
30
40
41
+ // synthesized symbols that point directly to their docs should also have a sourceOrigin field
42
+
43
+ // BONUS: "source": "s:13InheritedDocs1PPAAE9bonusFuncyyF::SYNTHESIZED::s:13InheritedDocs1SV"
44
+ // BONUS-NEXT: "target": "s:13InheritedDocs1SV"
45
+ // BONUS-NEXT: "sourceOrigin"
46
+ // BONUS-NEXT: "identifier": "s:13InheritedDocs1PPAAE9bonusFuncyyF"
47
+ // BONUS-NEXT: "displayName": "P.bonusFunc()"
48
+
31
49
/// Protocol P
32
50
public protocol P {
33
51
/// Some Function
@@ -36,6 +54,9 @@ public protocol P {
36
54
37
55
public extension P {
38
56
func someFunc( ) { }
57
+
58
+ /// Bonus docs!
59
+ func bonusFunc( ) { }
39
60
}
40
61
41
62
public struct S : P {
0 commit comments