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 {
482
482
// / Determine whether this type variable represents a subscript result type.
483
483
bool isSubscriptResultType () const ;
484
484
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
-
489
485
// / Determine whether this type variable represents an opened
490
486
// / type parameter pack.
491
487
bool isParameterPack () const ;
Original file line number Diff line number Diff line change @@ -1265,8 +1265,7 @@ static bool hasConversions(Type type) {
1265
1265
}
1266
1266
1267
1267
return !(type->is <StructType>() || type->is <EnumType>() ||
1268
- type->is <BuiltinType>() || type->is <ArchetypeType>() ||
1269
- type->isVoid ());
1268
+ type->is <BuiltinType>() || type->is <ArchetypeType>());
1270
1269
}
1271
1270
1272
1271
bool BindingSet::favoredOverDisjunction (Constraint *disjunction) const {
@@ -1282,16 +1281,9 @@ bool BindingSet::favoredOverDisjunction(Constraint *disjunction) const {
1282
1281
1283
1282
return !hasConversions (binding.BindingType );
1284
1283
})) {
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) {
1295
1287
return constraint->getKind () == ConstraintKind::Disjunction ||
1296
1288
constraint->getKind () == ConstraintKind::ValueMember;
1297
1289
}))
Original file line number Diff line number Diff line change @@ -175,16 +175,6 @@ bool TypeVariableType::Implementation::isSubscriptResultType() const {
175
175
KeyPathExpr::Component::Kind::UnresolvedSubscript;
176
176
}
177
177
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
-
188
178
bool TypeVariableType::Implementation::isParameterPack () const {
189
179
return locator
190
180
&& locator->isForGenericParameter ()
You can’t perform that action at this time.
0 commit comments