Skip to content

Commit 7089b35

Browse files
committed
[AST] NFC: Clarify when extension type repr wouldn't be available
1 parent a7988b0 commit 7089b35

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/swift/AST/Decl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,9 @@ class ExtensionDecl final : public GenericContext, public Decl,
13151315
bool alreadyBoundToNominal() const { return NextExtension.getInt(); }
13161316

13171317
/// Retrieve the extended type definition as written in the source, if it exists.
1318+
///
1319+
/// Repr would not be available if the extension was been loaded
1320+
/// from a serialized module.
13181321
TypeRepr *getExtendedTypeRepr() const { return ExtendedTypeRepr; }
13191322

13201323
/// Retrieve the set of protocols that this type inherits (i.e,

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7435,7 +7435,7 @@ bool InvalidMemberRefOnProtocolMetatype::diagnoseAsError() {
74357435
} else if (auto nameRepr = extension->getExtendedTypeRepr()) {
74367436
// Type repr is not always available so we need to be defensive
74377437
// about its presence and validity.
7438-
if (nameRepr->isInvalid()))
7438+
if (nameRepr->isInvalid())
74397439
return true;
74407440

74417441
if (auto noteLoc = nameRepr->getEndLoc()) {

0 commit comments

Comments
 (0)