@@ -1064,7 +1064,6 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
1064
1064
// If that failed, mark any variables binding pieces of the pattern
1065
1065
// as invalid to silence follow-on errors.
1066
1066
pattern->forEachVariable ([&](VarDecl *VD) {
1067
- VD->setInterfaceType (ErrorType::get (TC.Context ));
1068
1067
VD->setInvalid ();
1069
1068
});
1070
1069
}
@@ -1142,10 +1141,7 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
1142
1141
!vd->getType ()->isEqual (initialCaseVarDecl->getType ())) {
1143
1142
TC.diagnose (vd->getLoc (), diag::type_mismatch_multiple_pattern_list,
1144
1143
vd->getType (), initialCaseVarDecl->getType ());
1145
- vd->setInterfaceType (ErrorType::get (TC.Context ));
1146
1144
vd->setInvalid ();
1147
-
1148
- initialCaseVarDecl->setInterfaceType (ErrorType::get (TC.Context ));
1149
1145
initialCaseVarDecl->setInvalid ();
1150
1146
}
1151
1147
@@ -1166,10 +1162,7 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
1166
1162
if (foundVP)
1167
1163
diag.fixItReplace (foundVP->getLoc (),
1168
1164
initialCaseVarDecl->isLet () ? " let" : " var" );
1169
- vd->setInterfaceType (ErrorType::get (TC.Context ));
1170
1165
vd->setInvalid ();
1171
-
1172
- initialCaseVarDecl->setInterfaceType (ErrorType::get (TC.Context ));
1173
1166
initialCaseVarDecl->setInvalid ();
1174
1167
}
1175
1168
});
@@ -1237,10 +1230,7 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
1237
1230
TC.diagnose (previous->getLoc (),
1238
1231
diag::type_mismatch_fallthrough_pattern_list,
1239
1232
previous->getType (), expected->getType ());
1240
- previous->setInterfaceType (ErrorType::get (TC.Context ));
1241
1233
previous->setInvalid ();
1242
-
1243
- expected->setInterfaceType (ErrorType::get (TC.Context ));
1244
1234
expected->setInvalid ();
1245
1235
}
1246
1236
@@ -1476,7 +1466,6 @@ bool TypeChecker::typeCheckCatchPattern(CatchStmt *S, DeclContext *DC) {
1476
1466
// before we type-check the guard. (This will probably kill
1477
1467
// most of the type-checking, but maybe not.)
1478
1468
pattern->forEachVariable ([&](VarDecl *var) {
1479
- var->setInterfaceType (ErrorType::get (Context));
1480
1469
var->setInvalid ();
1481
1470
});
1482
1471
}
0 commit comments