File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -199,23 +199,9 @@ PatternBindingEntryRequest::evaluate(Evaluator &eval,
199
199
}
200
200
}
201
201
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.
209
203
auto contextualPattern =
210
204
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
-
219
205
Type patternType = TypeChecker::typeCheckPattern (contextualPattern);
220
206
if (patternType->hasError ()) {
221
207
swift::setBoundVarsTypeError (pattern, Context);
You can’t perform that action at this time.
0 commit comments