Skip to content

[TypeChecker] Remove remaining isInvalid checks from pattern handling #39417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/Sema/TypeCheckPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,6 @@ Pattern *TypeChecker::coercePatternToType(ContextualPattern pattern,
case PatternKind::Named: {
NamedPattern *NP = cast<NamedPattern>(P);
VarDecl *var = NP->getDecl();
if (var->hasInterfaceType() && var->isInvalid())
type = ErrorType::get(Context);

// In SIL mode, VarDecls are written as having reference storage types.
type = type->getReferenceStorageReferent();
Expand Down Expand Up @@ -1692,9 +1690,6 @@ void TypeChecker::coerceParameterListToType(ParameterList *P,
// Local function to check whether type of given parameter
// should be coerced to a given contextual type or not.
auto shouldOverwriteParam = [&](ParamDecl *param) -> bool {
if (param->isInvalid())
return true;

return !isValidType(param->getType());
};

Expand Down