Skip to content

Commit 38964fc

Browse files
committed
[Type checker] Remove dead code to compute pattern checking options.
1 parent a15a905 commit 38964fc

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -199,23 +199,9 @@ PatternBindingEntryRequest::evaluate(Evaluator &eval,
199199
}
200200
}
201201

202-
// Check the pattern. We treat type-checking a PatternBindingDecl like
203-
// type-checking an expression because that's how the initial binding is
204-
// checked, and they have the same effect on the file's dependencies.
205-
//
206-
// In particular, it's /not/ correct to check the PBD's DeclContext because
207-
// top-level variables in a script file are accessible from other files,
208-
// even though the PBD is inside a TopLevelCodeDecl.
202+
// Check the pattern.
209203
auto contextualPattern =
210204
ContextualPattern::forPatternBindingDecl(binding, entryNumber);
211-
TypeResolutionOptions options(TypeResolverContext::PatternBindingDecl);
212-
213-
if (binding->isInitialized(entryNumber)) {
214-
// If we have an initializer, we can also have unknown types.
215-
options |= TypeResolutionFlags::AllowUnspecifiedTypes;
216-
options |= TypeResolutionFlags::AllowUnboundGenerics;
217-
}
218-
219205
Type patternType = TypeChecker::typeCheckPattern(contextualPattern);
220206
if (patternType->hasError()) {
221207
swift::setBoundVarsTypeError(pattern, Context);

0 commit comments

Comments
 (0)