Skip to content

Commit b3fcba5

Browse files
authored
Merge pull request #39417 from apple/remote-invalid-checks-for-pattern-resolution
[TypeChecker] Remove remaining `isInvalid` checks from pattern handling
2 parents cb1e54c + 99ad3db commit b3fcba5

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/Sema/TypeCheckPattern.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,6 @@ Pattern *TypeChecker::coercePatternToType(ContextualPattern pattern,
11241124
case PatternKind::Named: {
11251125
NamedPattern *NP = cast<NamedPattern>(P);
11261126
VarDecl *var = NP->getDecl();
1127-
if (var->hasInterfaceType() && var->isInvalid())
1128-
type = ErrorType::get(Context);
11291127

11301128
// In SIL mode, VarDecls are written as having reference storage types.
11311129
type = type->getReferenceStorageReferent();
@@ -1692,9 +1690,6 @@ void TypeChecker::coerceParameterListToType(ParameterList *P,
16921690
// Local function to check whether type of given parameter
16931691
// should be coerced to a given contextual type or not.
16941692
auto shouldOverwriteParam = [&](ParamDecl *param) -> bool {
1695-
if (param->isInvalid())
1696-
return true;
1697-
16981693
return !isValidType(param->getType());
16991694
};
17001695

0 commit comments

Comments
 (0)