Skip to content

Commit 598b850

Browse files
committed
[CSClosure] Allow all declarations to use typeCheckDecl
This is necessary to ensure that all of the information is properly materialized, and access/availability and other required checks are performed.
1 parent d5e9a39 commit 598b850

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Sema/CSClosure.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,14 @@ class ClosureConstraintApplication
894894
// Generate constraints for pattern binding declarations.
895895
if (auto patternBinding = dyn_cast<PatternBindingDecl>(decl)) {
896896
SolutionApplicationTarget target(patternBinding);
897-
if (!rewriteTarget(target))
897+
if (!rewriteTarget(target)) {
898898
hadError = true;
899+
return;
900+
}
899901

900-
return;
902+
// Allow `typeCheckDecl` to be called after solution is applied
903+
// to a pattern binding. That would materialize required
904+
// information e.g. accessors and do access/availability checks.
901905
}
902906

903907
TypeChecker::typeCheckDecl(decl);

0 commit comments

Comments
 (0)