Skip to content

Commit 08fe7c2

Browse files
[SymbolGraph] don't filter out all implicit decls
1 parent 377ca35 commit 08fe7c2

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

lib/SymbolGraphGen/SymbolGraph.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,6 @@ bool SymbolGraph::canIncludeDeclAsNode(const Decl *D) const {
655655
return false;
656656
}
657657

658-
if (D->isImplicit()) {
659-
return false;
660-
}
661-
662658
if (!isa<ValueDecl>(D)) {
663659
return false;
664660
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift %s -module-name Implicit -emit-module -emit-module-path %t/
3+
// RUN: %target-swift-symbolgraph-extract -module-name Implicit -I %t -pretty-print -output-dir %t -minimum-access-level internal
4+
// RUN: %FileCheck %s --input-file %t/Implicit.symbols.json
5+
6+
// RUN: %target-swift-symbolgraph-extract -module-name Implicit -I %t -pretty-print -output-dir %t
7+
// RUN: %FileCheck %s --input-file %t/Implicit.symbols.json --check-prefix PUBLIC
8+
9+
public class SomeClass {}
10+
11+
public struct SomeStruct {
12+
let bar: Int
13+
let other: String
14+
}
15+
16+
// make sure that the implicitly-generated initializer appears when the access level is `internal`
17+
// CHECK-DAG: "precise": "s:8Implicit9SomeClassCACycfc"
18+
// CHECK-DAG: "precise": "s:8Implicit10SomeStructV3bar5otherACSi_SStcfc"
19+
20+
// ...but that they don't show up when it's `public`, since they're marked `internal` to begin with
21+
// PUBLIC-NOT: "precise": "s:8Implicit9SomeClassCACycfc"
22+
// PUBLIC-NOT: "precise": "s:8Implicit10SomeStructV3bar5otherACSi_SStcfc"

0 commit comments

Comments
 (0)