Skip to content

Commit 8ae8dbc

Browse files
add situations where inheriting docs shouldn't happen
1 parent 81bc80d commit 8ae8dbc

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

test/SymbolGraph/Relationships/Synthesized/Inputs/RemoteP.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ public protocol P {
77

88
func bonusFunc()
99
}
10+
11+
public extension P {
12+
/// Extra default docs!
13+
func extraFunc() {}
14+
}

test/SymbolGraph/Relationships/Synthesized/RemoteInheritedDocs.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix BONUS
99
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix INHERIT
1010
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix LOCAL
11+
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix OVERRIDE
1112

1213
// RUN: %target-swift-symbolgraph-extract -module-name RemoteInheritedDocs -I %t -pretty-print -output-dir %t -skip-inherited-docs
1314
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix SOME
1415
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix OTHER
1516
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix BONUS
1617
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix SKIP
1718
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix LOCAL
19+
// RUN: %FileCheck %s --input-file %t/RemoteInheritedDocs.symbols.json --check-prefix OVERRIDE
1820

1921
// SOME: "source": "s:19RemoteInheritedDocs1SV8someFuncyyF"
2022
// SOME-NEXT: "target": "s:19RemoteInheritedDocs1SV"
@@ -39,18 +41,31 @@
3941

4042
// LOCAL: Local docs override!
4143

44+
// OVERRIDE-NOT: Extra default docs!
45+
// OVERRIDE-NOT: Extension override!
46+
4247
import RemoteP
4348

4449
// The `RemoteP.P` protocol has three methods: `someFunc` and `bonusFunc` don't have docs upstream,
4550
// but `otherFunc` does. Regardless, each one needs a `sourceOrigin` field connecting it to
4651
// upstream.
4752

53+
// `RemoteP.P` also has an extension with a default implementation for `extraFunc` that does have
54+
// docs, but overriding it here should prevent those from appearing
55+
4856
public struct S: P {
4957
public func someFunc() {}
5058

5159
public func otherFunc() {}
5260

5361
/// Local docs override!
5462
public func bonusFunc() {}
63+
64+
public func extraFunc() {}
65+
}
66+
67+
public extension P {
68+
/// Extension override!
69+
func someFunc() {}
5570
}
5671

0 commit comments

Comments
 (0)