Skip to content

Commit 64c6b09

Browse files
authored
Merge pull request #14743 from alblue/SR-7041
2 parents f6fd4eb + 3e04e32 commit 64c6b09

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,14 +2276,10 @@ bool TypeChecker::typeCheckPatternBinding(PatternBindingDecl *PBD,
22762276

22772277
// If we entered an initializer context, contextualize any
22782278
// auto-closures we might have created.
2279-
if (initContext) {
2279+
if (initContext && !hadError) {
22802280
// Check safety of error-handling in the declaration, too.
2281-
if (!hadError) {
2282-
checkInitializerErrorHandling(initContext, init);
2283-
}
2284-
2285-
if (!hadError)
2286-
(void)contextualizeInitializer(initContext, init);
2281+
checkInitializerErrorHandling(initContext, init);
2282+
(void)contextualizeInitializer(initContext, init);
22872283
}
22882284

22892285
if (hadError) {

0 commit comments

Comments
 (0)