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
9
// 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
11
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes SUPER
10
12
11
13
// RUN: %target-swift-symbolgraph-extract -module-name InheritedDocs -I %t -pretty-print -output-dir %t -skip-inherited-docs
12
14
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes CHECK,SKIP
13
15
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes IMPL
14
16
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS
15
17
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes BONUS-SKIP
16
18
// RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes EXTRA
19
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes LOCAL
20
+ // RUN: %FileCheck %s --input-file %t/InheritedDocs.symbols.json --check-prefixes SUPER
17
21
18
22
// RUN: %empty-directory(%t)
19
23
// 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
56
60
// EXTRA-NEXT: "identifier": "s:13InheritedDocs1PPAAE9extraFuncyyF"
57
61
// EXTRA-NEXT: "displayName": "P.extraFunc()"
58
62
63
+ // local implementations of a local protocol still need to a relation to that protocol
64
+
65
+ // LOCAL: "source": "s:13InheritedDocs1SV9localFuncyyF"
66
+ // LOCAL-NEXT: "target": "s:13InheritedDocs1SV"
67
+ // LOCAL-NEXT: "sourceOrigin"
68
+ // LOCAL-NEXT: "identifier": "s:13InheritedDocs1PP9localFuncyyF"
69
+ // LOCAL-NEXT: "displayName": "P.localFunc()"
70
+
71
+ // ...both with and without docs
72
+
73
+ // SUPER: "source": "s:13InheritedDocs1SV9superFuncyyF"
74
+ // SUPER-NEXT: "target": "s:13InheritedDocs1SV"
75
+ // SUPER-NEXT: "sourceOrigin"
76
+ // SUPER-NEXT: "identifier": "s:13InheritedDocs1PP9superFuncyyF"
77
+ // SUPER-NEXT: "displayName": "P.superFunc()"
78
+
59
79
/// Protocol P
60
80
public protocol P {
61
81
/// Some Function
62
82
func someFunc( )
83
+
84
+ /// It's a local function!
85
+ func localFunc( )
86
+
87
+ func superFunc( )
63
88
}
64
89
65
90
public extension P {
@@ -72,4 +97,7 @@ public extension P {
72
97
}
73
98
74
99
public struct S : P {
100
+ public func localFunc( ) { }
101
+
102
+ public func superFunc( ) { }
75
103
}
0 commit comments