Skip to content

Commit eec924b

Browse files
committed
Sema: Fix crash in diagnoseIfSynthesisUnsupportedForDecl() with tuple extension
1 parent 9a01e87 commit eec924b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
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+
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// {"signature":"swift::GenericContext::getGenericParams() const"}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: not %target-swift-frontend -typecheck %s
33
typealias a = () extension a : Comparable

0 commit comments

Comments
 (0)