Skip to content

Commit bea1ba4

Browse files
committed
AST: Add breadcrumb for crashes in GenericFunctionType canonicalization
1 parent 212b10a commit bea1ba4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/Type.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "swift/AST/Module.h"
3232
#include "swift/AST/PackConformance.h"
3333
#include "swift/AST/ParameterList.h"
34+
#include "swift/AST/PrettyStackTrace.h"
3435
#include "swift/AST/ProtocolConformance.h"
3536
#include "swift/AST/SILLayout.h"
3637
#include "swift/AST/SubstitutionMap.h"
@@ -1748,6 +1749,9 @@ CanType TypeBase::computeCanonicalType() {
17481749
case TypeKind::GenericFunction: {
17491750
AnyFunctionType *funcTy = cast<AnyFunctionType>(this);
17501751

1752+
PrettyStackTraceType trace(funcTy->getResult()->getASTContext(),
1753+
"computing canonical type for ", this);
1754+
17511755
CanGenericSignature genericSig;
17521756
if (auto *genericFnTy = dyn_cast<GenericFunctionType>(this))
17531757
genericSig = genericFnTy->getGenericSignature().getCanonicalSignature();

0 commit comments

Comments
 (0)