Skip to content

Commit f9ff0c5

Browse files
committed
[AST] NFC: Add doc comment for isSynthesized
Make it clear why this is a different bit to `isImplicit`.
1 parent e91633e commit f9ff0c5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/swift/AST/Decl.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,6 +2848,15 @@ class ValueDecl : public Decl {
28482848
return Bits.ValueDecl.IsUserAccessible;
28492849
}
28502850

2851+
/// Whether this decl has been synthesized by the compiler for use by the
2852+
/// user.
2853+
///
2854+
/// This is a refinement of isImplicit; all synthesized decls are implicit,
2855+
/// but not all implicit decls are synthesized. The difference comes down to
2856+
/// whether or not the decl is user-facing, e.g the implicit memberwise
2857+
/// initializer is considered synthesized. Decls that are only meant for the
2858+
/// compiler, e.g the implicit FuncDecl for a DeferStmt, are not considered
2859+
/// synthesized.
28512860
bool isSynthesized() const {
28522861
return Bits.ValueDecl.Synthesized;
28532862
}

0 commit comments

Comments
 (0)