6
6
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
7
7
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
8
8
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS-DOCS
9
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes EXTRA
9
10
10
11
// RUN: %target-swift-symbolgraph-extract -module-name InheritedDocs -I %t -pretty-print -output-dir %t -skip-inherited-docs
11
12
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes CHECK,SKIP
12
13
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
13
14
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
14
15
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS-SKIP
16
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes EXTRA
15
17
16
18
// RUN: %empty-directory(%t)
17
19
// 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
46
48
// BONUS-NEXT: "identifier": "s:13InheritedDocs1PPAAE9bonusFuncyyF"
47
49
// BONUS-NEXT: "displayName": "P.bonusFunc()"
48
50
51
+ // synthesized symbols that don't have docs to inherit still need to have the sourceOrigin field
52
+
53
+ // EXTRA: "source": "s:13InheritedDocs1PPAAE9extraFuncyyF::SYNTHESIZED::s:13InheritedDocs1SV"
54
+ // EXTRA-NEXT: "target": "s:13InheritedDocs1SV"
55
+ // EXTRA-NEXT: "sourceOrigin"
56
+ // EXTRA-NEXT: "identifier": "s:13InheritedDocs1PPAAE9extraFuncyyF"
57
+ // EXTRA-NEXT: "displayName": "P.extraFunc()"
58
+
49
59
/// Protocol P
50
60
public protocol P {
51
61
/// Some Function
@@ -57,6 +67,8 @@ public extension P {
57
67
58
68
/// Bonus docs!
59
69
func bonusFunc( ) { }
70
+
71
+ func extraFunc( ) { } // no docs, but still needs sourceOrigin
60
72
}
61
73
62
74
public struct S : P {
0 commit comments