@@ -2181,7 +2181,6 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2,
21812181 case ConstraintKind::ValueWitness:
21822182 case ConstraintKind::BridgingConversion:
21832183 case ConstraintKind::OneWayEqual:
2184- case ConstraintKind::OneWayBindParam:
21852184 case ConstraintKind::FallbackType:
21862185 case ConstraintKind::UnresolvedMemberChainBase:
21872186 case ConstraintKind::PropertyWrapper:
@@ -2553,7 +2552,6 @@ static bool matchFunctionRepresentations(FunctionType::ExtInfo einfo1,
25532552 case ConstraintKind::ValueMember:
25542553 case ConstraintKind::ValueWitness:
25552554 case ConstraintKind::OneWayEqual:
2556- case ConstraintKind::OneWayBindParam:
25572555 case ConstraintKind::FallbackType:
25582556 case ConstraintKind::UnresolvedMemberChainBase:
25592557 case ConstraintKind::PropertyWrapper:
@@ -3198,7 +3196,6 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
31983196 case ConstraintKind::ValueWitness:
31993197 case ConstraintKind::BridgingConversion:
32003198 case ConstraintKind::OneWayEqual:
3201- case ConstraintKind::OneWayBindParam:
32023199 case ConstraintKind::FallbackType:
32033200 case ConstraintKind::UnresolvedMemberChainBase:
32043201 case ConstraintKind::PropertyWrapper:
@@ -7134,7 +7131,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
71347131 case ConstraintKind::ValueMember:
71357132 case ConstraintKind::ValueWitness:
71367133 case ConstraintKind::OneWayEqual:
7137- case ConstraintKind::OneWayBindParam:
71387134 case ConstraintKind::FallbackType:
71397135 case ConstraintKind::UnresolvedMemberChainBase:
71407136 case ConstraintKind::PropertyWrapper:
@@ -11594,14 +11590,9 @@ ConstraintSystem::simplifyOneWayConstraint(
1159411590
1159511591 // Translate this constraint into an equality or bind-parameter constraint,
1159611592 // as appropriate.
11597- if (kind == ConstraintKind::OneWayEqual) {
11598- return matchTypes(first, secondSimplified, ConstraintKind::Equal, flags,
11599- locator);
11600- }
11601-
11602- assert(kind == ConstraintKind::OneWayBindParam);
11603- return matchTypes(
11604- secondSimplified, first, ConstraintKind::BindParam, flags, locator);
11593+ ASSERT(kind == ConstraintKind::OneWayEqual);
11594+ return matchTypes(first, secondSimplified, ConstraintKind::Equal, flags,
11595+ locator);
1160511596}
1160611597
1160711598ConstraintSystem::SolutionKind
@@ -11844,12 +11835,6 @@ bool ConstraintSystem::resolveClosure(TypeVariableType *typeVar,
1184411835 // Determine whether a result builder will be applied.
1184511836 auto resultBuilderType = getOpenedResultBuilderTypeFor(*this, locator);
1184611837
11847- // Determine whether to introduce one-way constraints between the parameter's
11848- // type as seen in the body of the closure and the external parameter
11849- // type.
11850- bool oneWayConstraints =
11851- getASTContext().LangOpts.hasFeature(Feature::OneWayClosureParameters);
11852-
1185311838 auto *paramList = closure->getParameters();
1185411839 SmallVector<AnyFunctionType::Param, 4> parameters;
1185511840 bool hasIsolatedParam = false;
@@ -11942,19 +11927,6 @@ bool ConstraintSystem::resolveClosure(TypeVariableType *typeVar,
1194211927 // - `Int...` -> `[Int]`,
1194311928 // - `inout Int` -> `@lvalue Int`.
1194411929 internalType = param.getParameterType();
11945-
11946- // When there are type variables in the type and we have enabled
11947- // one-way constraints, create a fresh type variable to handle the
11948- // binding.
11949- if (oneWayConstraints && internalType->hasTypeVariable()) {
11950- auto *paramLoc =
11951- getConstraintLocator(closure, LocatorPathElt::TupleElement(i));
11952- auto *typeVar = createTypeVariable(paramLoc, TVO_CanBindToLValue |
11953- TVO_CanBindToNoEscape);
11954- addConstraint(
11955- ConstraintKind::OneWayBindParam, typeVar, internalType, paramLoc);
11956- internalType = typeVar;
11957- }
1195811930 } else {
1195911931 auto *paramLoc =
1196011932 getConstraintLocator(closure, LocatorPathElt::TupleElement(i));
@@ -11986,13 +11958,8 @@ bool ConstraintSystem::resolveClosure(TypeVariableType *typeVar,
1198611958 addConstraint(ConstraintKind::Bind, externalType, paramTy, paramLoc);
1198711959 }
1198811960
11989- if (oneWayConstraints) {
11990- addConstraint(
11991- ConstraintKind::OneWayBindParam, typeVar, externalType, paramLoc);
11992- } else {
11993- addConstraint(
11994- ConstraintKind::BindParam, externalType, typeVar, paramLoc);
11995- }
11961+ addConstraint(
11962+ ConstraintKind::BindParam, externalType, typeVar, paramLoc);
1199611963 }
1199711964
1199811965 hasIsolatedParam |= param.isIsolated();
@@ -15760,7 +15727,6 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
1576015727 return simplifyPropertyWrapperConstraint(first, second, subflags, locator);
1576115728
1576215729 case ConstraintKind::OneWayEqual:
15763- case ConstraintKind::OneWayBindParam:
1576415730 return simplifyOneWayConstraint(kind, first, second, subflags, locator);
1576515731
1576615732 case ConstraintKind::UnresolvedMemberChainBase:
@@ -16341,7 +16307,6 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
1634116307 return SolutionKind::Unsolved;
1634216308
1634316309 case ConstraintKind::OneWayEqual:
16344- case ConstraintKind::OneWayBindParam:
1634516310 return simplifyOneWayConstraint(
1634616311 constraint.getKind(), constraint.getFirstType(),
1634716312 constraint.getSecondType(),
0 commit comments