Skip to content

Commit 20a8ddc

Browse files
committed
[NFC] Drop Written-But-Never-Read Error Bits
AFAICT This code is dead as of 61ac253 and what really matters is not that we've thrown an error but rather that coercing the pattern fails.
1 parent 0683b3f commit 20a8ddc

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/Sema/TypeCheckPattern.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,6 @@ Pattern *TypeChecker::coercePatternToType(ContextualPattern pattern,
10871087
case PatternKind::Typed: {
10881088
TypedPattern *TP = cast<TypedPattern>(P);
10891089
Type patternType = TypeChecker::typeCheckPattern(pattern);
1090-
bool hadError = false;
10911090
if (!patternType->hasError()) {
10921091
if (!type->isEqual(patternType) && !type->hasError()) {
10931092
if (options & TypeResolutionFlags::OverrideType) {
@@ -1101,11 +1100,8 @@ Pattern *TypeChecker::coercePatternToType(ContextualPattern pattern,
11011100
} else {
11021101
diags.diagnose(P->getLoc(), diag::pattern_type_mismatch_context,
11031102
type);
1104-
hadError = true;
11051103
}
11061104
}
1107-
} else {
1108-
hadError = true;
11091105
}
11101106

11111107
Pattern *sub = TP->getSubPattern();

0 commit comments

Comments
 (0)