File tree Expand file tree Collapse file tree 3 files changed +4
-26
lines changed
Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -482,10 +482,6 @@ class TypeVariableType::Implementation {
482482 // / Determine whether this type variable represents a subscript result type.
483483 bool isSubscriptResultType () const ;
484484
485- // / Determine whether this type variable represents a result type of an
486- // / application i.e. a call, an operator, or a subscript.
487- bool isApplicationResultType () const ;
488-
489485 // / Determine whether this type variable represents an opened
490486 // / type parameter pack.
491487 bool isParameterPack () const ;
Original file line number Diff line number Diff line change @@ -1265,8 +1265,7 @@ static bool hasConversions(Type type) {
12651265 }
12661266
12671267 return !(type->is <StructType>() || type->is <EnumType>() ||
1268- type->is <BuiltinType>() || type->is <ArchetypeType>() ||
1269- type->isVoid ());
1268+ type->is <BuiltinType>() || type->is <ArchetypeType>());
12701269}
12711270
12721271bool BindingSet::favoredOverDisjunction (Constraint *disjunction) const {
@@ -1282,16 +1281,9 @@ bool BindingSet::favoredOverDisjunction(Constraint *disjunction) const {
12821281
12831282 return !hasConversions (binding.BindingType );
12841283 })) {
1285- bool isApplicationResultType = TypeVar->getImpl ().isApplicationResultType ();
1286- if (llvm::none_of (Info.DelayedBy , [&isApplicationResultType](
1287- const Constraint *constraint) {
1288- // Let's not attempt to bind result type before application
1289- // happens. For example because it could be discardable or
1290- // l-value (subscript applications).
1291- if (isApplicationResultType &&
1292- constraint->getKind () == ConstraintKind::ApplicableFunction)
1293- return true ;
1294-
1284+ // Result type of subscript could be l-value so we can't bind it early.
1285+ if (!TypeVar->getImpl ().isSubscriptResultType () &&
1286+ llvm::none_of (Info.DelayedBy , [](const Constraint *constraint) {
12951287 return constraint->getKind () == ConstraintKind::Disjunction ||
12961288 constraint->getKind () == ConstraintKind::ValueMember;
12971289 }))
Original file line number Diff line number Diff line change @@ -175,16 +175,6 @@ bool TypeVariableType::Implementation::isSubscriptResultType() const {
175175 KeyPathExpr::Component::Kind::UnresolvedSubscript;
176176}
177177
178- bool TypeVariableType::Implementation::isApplicationResultType () const {
179- if (!(locator && locator->getAnchor ()))
180- return false ;
181-
182- if (!locator->isLastElement <LocatorPathElt::FunctionResult>())
183- return false ;
184-
185- return isExpr<ApplyExpr>(locator->getAnchor ()) || isSubscriptResultType ();
186- }
187-
188178bool TypeVariableType::Implementation::isParameterPack () const {
189179 return locator
190180 && locator->isForGenericParameter ()
You can’t perform that action at this time.
0 commit comments