Skip to content

Commit c14391d

Browse files
authored
Merge pull request #6076 from benlangmuir/fix-040
2 parents 081ae71 + 1ca799b commit c14391d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ bool TypeChecker::typeCheckConstructorBodyUntil(ConstructorDecl *ctor,
14061406
// Determine whether we need to introduce a super.init call.
14071407
auto nominalDecl = ctor->getDeclContext()
14081408
->getAsNominalTypeOrNominalTypeExtensionContext();
1409-
ClassDecl *ClassD = dyn_cast<ClassDecl>(nominalDecl);
1409+
ClassDecl *ClassD = dyn_cast_or_null<ClassDecl>(nominalDecl);
14101410
bool wantSuperInitCall = false;
14111411
if (ClassD) {
14121412
bool isDelegating = false;

validation-test/IDE/crashers/040-swift-typechecker-typecheckconstructorbodyuntil.swift

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
t{extension{init(){#^A^#

0 commit comments

Comments
 (0)