Skip to content

Commit c8a60c8

Browse files
committed
Patterns with multiple variables can support initialization
1 parent a10194c commit c8a60c8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,14 @@ const PatternBindingEntry *PatternBindingEntryRequest::evaluate(
515515
}
516516

517517
auto supportsInitialization = [&] {
518-
auto *var = binding->getSingleVar();
519-
return var && var->supportsInitialization();
518+
bool anySupportsInitialization = false;
519+
pattern->forEachVariable([&](VarDecl *var) {
520+
if (var->supportsInitialization()) {
521+
anySupportsInitialization = true;
522+
}
523+
});
524+
525+
return anySupportsInitialization;
520526
};
521527

522528
// If we have a type but no initializer, check whether the type is

0 commit comments

Comments
 (0)