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
99// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes EXTRA
10+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes LOCAL
1011
1112// RUN: %target-swift-symbolgraph-extract -module-name InheritedDocs -I %t -pretty-print -output-dir %t -skip-inherited-docs
1213// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes CHECK,SKIP
1314// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
1415// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
1516// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS-SKIP
1617// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes EXTRA
18+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes LOCAL
1719
1820// RUN: %empty-directory(%t)
1921// 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
5658// EXTRA-NEXT: "identifier": "s:13InheritedDocs1PPAAE9extraFuncyyF"
5759// EXTRA-NEXT: "displayName": "P.extraFunc()"
5860
61+ // local implementations of a local protocol still need to a relation to that protocol
62+
63+ // LOCAL: "source": "s:13InheritedDocs1SV9localFuncyyF"
64+ // LOCAL-NEXT: "target": "s:13InheritedDocs1SV"
65+ // LOCAL-NEXT: "sourceOrigin"
66+ // LOCAL-NEXT: "identifier": "s:13InheritedDocs1PP9localFuncyyF"
67+ // LOCAL-NEXT: "displayName": "P.localFunc()"
68+
5969/// Protocol P
6070public protocol P {
6171 /// Some Function
6272 func someFunc( )
73+
74+ /// It's a local function!
75+ func localFunc( )
6376}
6477
6578public extension P {
@@ -72,4 +85,5 @@ public extension P {
7285}
7386
7487public struct S : P {
88+ public func localFunc( ) { }
7589}
0 commit comments