@@ -677,52 +677,12 @@ ConstraintLocator *ConstraintSystem::getConstraintLocator(
677677 return getConstraintLocator (anchor, newPath);
678678}
679679
680- ConstraintLocator *ConstraintSystem::getImplicitValueConversionLocator (
681- ConstraintLocatorBuilder root, ConversionRestrictionKind restriction) {
682- SmallVector<LocatorPathElt, 4 > path;
683- auto anchor = root.getLocatorParts (path);
684- {
685- if (isExpr<DictionaryExpr>(anchor) && path.size () > 1 ) {
686- // Drop everything except for first `tuple element #`.
687- path.pop_back_n (path.size () - 1 );
688- }
689-
690- // Drop any value-to-optional conversions that were applied along the
691- // way to reach this one.
692- while (!path.empty ()) {
693- if (path.back ().is <LocatorPathElt::OptionalInjection>()) {
694- path.pop_back ();
695- continue ;
696- }
697- break ;
698- }
699-
700- // If conversion is for a tuple element, let's drop `TupleType`
701- // components from the path since they carry information for
702- // diagnostics that `ExprRewriter` won't be able to re-construct
703- // during solution application.
704- if (!path.empty () && path.back ().is <LocatorPathElt::TupleElement>()) {
705- path.erase (llvm::remove_if (path,
706- [](const LocatorPathElt &elt) {
707- return elt.is <LocatorPathElt::TupleType>();
708- }),
709- path.end ());
710- }
711- }
712-
713- return getConstraintLocator (/* base=*/ getConstraintLocator (anchor, path),
714- LocatorPathElt::ImplicitConversion (restriction));
715- }
716-
717680ConstraintLocator *ConstraintSystem::getCalleeLocator (
718681 ConstraintLocator *locator, bool lookThroughApply,
719682 llvm::function_ref<Type(Expr *)> getType,
720683 llvm::function_ref<Type(Type)> simplifyType,
721684 llvm::function_ref<std::optional<SelectedOverload>(ConstraintLocator *)>
722685 getOverloadFor) {
723- if (locator->findLast <LocatorPathElt::ImplicitConversion>())
724- return locator;
725-
726686 auto anchor = locator->getAnchor ();
727687 auto path = locator->getPath ();
728688 {
@@ -3909,9 +3869,6 @@ void constraints::simplifyLocator(ASTNode &anchor,
39093869 break ;
39103870 }
39113871
3912- case ConstraintLocator::ImplicitConversion:
3913- break ;
3914-
39153872 case ConstraintLocator::Witness:
39163873 case ConstraintLocator::WrappedValue:
39173874 case ConstraintLocator::ImplicitlyUnwrappedDisjunctionChoice:
@@ -4064,9 +4021,6 @@ ConstraintSystem::getArgumentInfoLocator(ConstraintLocator *locator) {
40644021 if (anchor.isNull () && locator->getPath ().empty ())
40654022 return nullptr ;
40664023
4067- if (locator->findLast <LocatorPathElt::ImplicitConversion>())
4068- return locator;
4069-
40704024 // Applies and unresolved member exprs can have callee locators that are
40714025 // dependent on the type of their function, which may not have been resolved
40724026 // yet. Therefore we need to handle them specially.
0 commit comments