Skip to content

Commit e507bcf

Browse files
authored
Merge pull request #36792 from LucianoPAlmeida/failure-diagnostics-left
[CSGen] Removing code that was only necessary for failure diagnostics
2 parents 5af9100 + a028a0d commit e507bcf

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

lib/Sema/CSGen.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,29 +1253,6 @@ namespace {
12531253
CS.setFavoredType(E, knownType.getPointer());
12541254
}
12551255
}
1256-
1257-
// This can only happen when failure diagnostics is trying
1258-
// to type-check expressions inside of a single-statement
1259-
// closure which refer to anonymous parameters, in this case
1260-
// let's either use type as written or allocate a fresh type
1261-
// variable, just like we do for closure type.
1262-
// FIXME: We should eliminate this case.
1263-
if (auto *PD = dyn_cast<ParamDecl>(VD)) {
1264-
if (!CS.hasType(PD)) {
1265-
if (knownType &&
1266-
(knownType->hasUnboundGenericType() ||
1267-
knownType->hasPlaceholder())) {
1268-
knownType = CS.replaceInferableTypesWithTypeVars(knownType,
1269-
locator);
1270-
}
1271-
1272-
CS.setType(
1273-
PD, knownType ? knownType
1274-
: CS.createTypeVariable(locator,
1275-
TVO_CanBindToLValue |
1276-
TVO_CanBindToNoEscape));
1277-
}
1278-
}
12791256
}
12801257

12811258
// If declaration is invalid, let's turn it into a potential hole

0 commit comments

Comments
 (0)