Skip to content

Commit ce9028f

Browse files
committed
[Sema] Set pattern on failure in typeCheckBinding
I don't think this currently affects anything, but match what we do for the expression and update the pattern if type-checking the initialization fails.
1 parent fef7f53 commit ce9028f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ bool TypeChecker::typeCheckBinding(Pattern *&pattern, Expr *&initializer,
854854

855855
auto &Context = DC->getASTContext();
856856
initializer = target.getAsExpr();
857+
pattern = target.getInitializationPattern();
857858

858859
if (!initializer->getType())
859860
initializer->setType(ErrorType::get(Context));

0 commit comments

Comments
 (0)