Skip to content

Commit 28ea3e1

Browse files
committed
[NFC] Document TypeAliasDecl::isCompatibilityAlias
1 parent 6c18a03 commit 28ea3e1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

include/swift/AST/Decl.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2996,11 +2996,29 @@ class TypeAliasDecl : public GenericTypeDecl {
29962996
/// Retrieve a sugared interface type containing the structure of the interface
29972997
/// type before any semantic validation has occured.
29982998
Type getStructuralType() const;
2999-
2999+
3000+
/// Whether the typealias forwards perfectly to its underlying type.
3001+
///
3002+
/// If true, this typealias was created by ClangImporter to preserve source
3003+
/// compatibility with a previous language version's name for a type. Many
3004+
/// checks in Sema look through compatibility aliases even when they would
3005+
/// operate on other typealiases.
3006+
///
3007+
/// \warning This has absolutely nothing to do with the Objective-C
3008+
/// \c compatibility_alias keyword.
30003009
bool isCompatibilityAlias() const {
30013010
return Bits.TypeAliasDecl.IsCompatibilityAlias;
30023011
}
30033012

3013+
/// Sets whether the typealias forwards perfectly to its underlying type.
3014+
///
3015+
/// Marks this typealias as having been created by ClangImporter to preserve
3016+
/// source compatibility with a previous language version's name for a type.
3017+
/// Many checks in Sema look through compatibility aliases even when they
3018+
/// would operate on other typealiases.
3019+
///
3020+
/// \warning This has absolutely nothing to do with the Objective-C
3021+
/// \c compatibility_alias keyword.
30043022
void markAsCompatibilityAlias(bool newValue = true) {
30053023
Bits.TypeAliasDecl.IsCompatibilityAlias = newValue;
30063024
}

0 commit comments

Comments
 (0)