Skip to content

Commit 5fbd756

Browse files
committed
[Type checker] Don’t form a cycle when printing a request on an extension.
1 parent 713c92d commit 5fbd756

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/AST/TypeCheckRequests.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "swift/AST/Decl.h"
1414
#include "swift/AST/DiagnosticsCommon.h"
1515
#include "swift/AST/TypeLoc.h"
16+
#include "swift/AST/TypeRepr.h"
1617
#include "swift/AST/Types.h"
1718

1819
using namespace swift;
@@ -36,7 +37,10 @@ void swift::simple_display(
3637

3738
auto ext = value.get<ExtensionDecl *>();
3839
out << "extension of ";
39-
ext->getAsNominalTypeOrNominalTypeExtensionContext()->dumpRef(out);
40+
if (auto typeRepr = ext->getExtendedTypeLoc().getTypeRepr())
41+
typeRepr->print(out);
42+
else
43+
ext->getAsNominalTypeOrNominalTypeExtensionContext()->dumpRef(out);
4044
}
4145

4246
//----------------------------------------------------------------------------//

0 commit comments

Comments
 (0)