66// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
77// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
88// 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
910
1011// RUN: %target-swift-symbolgraph-extract -module-name InheritedDocs -I %t -pretty-print -output-dir %t -skip-inherited-docs
1112// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes CHECK,SKIP
1213// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
1314// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
1415// 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
1517
1618// RUN: %empty-directory(%t)
1719// 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
4648// BONUS-NEXT: "identifier": "s:13InheritedDocs1PPAAE9bonusFuncyyF"
4749// BONUS-NEXT: "displayName": "P.bonusFunc()"
4850
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+
4959/// Protocol P
5060public protocol P {
5161 /// Some Function
@@ -57,6 +67,8 @@ public extension P {
5767
5868 /// Bonus docs!
5969 func bonusFunc( ) { }
70+
71+ func extraFunc( ) { } // no docs, but still needs sourceOrigin
6072}
6173
6274public struct S : P {
0 commit comments