Merge pull request #85525 from hamishknight/yeet

[CS] Remove `getImplicitValueConversionLocator` & `ImplicitConversion`
This commit is contained in:
Hamish Knight
2025-11-17 14:03:13 +00:00
committed by GitHub
7 changed files with 1 additions and 103 deletions

View File

@@ -7743,16 +7743,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
isExpr<ForcedCheckedCastExpr>(anchor);
};
if (!isCGFloatInit(anchor) && !isCoercionOrCast(anchor, path) &&
llvm::none_of(path, [&](const LocatorPathElt &rawElt) {
if (auto elt =
rawElt.getAs<LocatorPathElt::ImplicitConversion>()) {
auto convKind = elt->getConversionKind();
return convKind == ConversionRestrictionKind::DoubleToCGFloat ||
convKind == ConversionRestrictionKind::CGFloatToDouble;
}
return false;
})) {
if (!isCGFloatInit(anchor) && !isCoercionOrCast(anchor, path)) {
conversionsOrFixes.push_back(
desugar1->isCGFloat()
? ConversionRestrictionKind::CGFloatToDouble
@@ -11035,10 +11026,6 @@ static ConstraintFix *validateInitializerRef(ConstraintSystem &cs,
if (!anchor)
return nullptr;
// Avoid checking implicit conversions injected by the compiler.
if (locator->findFirst<LocatorPathElt::ImplicitConversion>())
return nullptr;
auto getType = [&cs](Expr *expr) -> Type {
return cs.simplifyType(cs.getType(expr))->getRValueType();
};