Skip to content

Commit 0fae4cb

Browse files
committed
Sema: Fix crash in diagnoseIfSynthesisUnsupportedForDecl() with tuple extension
1 parent 1594819 commit 0fae4cb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/Sema/DerivedConformance/DerivedConformance.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ void DerivedConformance::diagnoseIfSynthesisUnsupportedForDecl(
272272
shouldDiagnose = !isa<EnumDecl>(nominal);
273273
}
274274

275+
if (isa<BuiltinTupleDecl>(nominal))
276+
shouldDiagnose = false;
277+
275278
if (shouldDiagnose) {
276279
auto &ctx = nominal->getASTContext();
277280
ctx.Diags.diagnose(nominal->getLoc(),
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
// Just don't crash.
4+
extension () : Comparable {}
5+

0 commit comments

Comments
 (0)