Skip to content

Commit f14820d

Browse files
committed
Sema: Don't generate OneWayEqual constraints for pattern bindings
I had to revert #78301 to fix rdar://143338891. This now brings back the change, but without deleting code; instead, it's guarded by the -disable-optimized-restrictions flag. Once the flag is removed, I will once again completely delete OneWayEqual constraints.
1 parent 357474a commit f14820d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/CSGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2704,7 +2704,8 @@ namespace {
27042704
// type variable and a one-way constraint to assign it to either the
27052705
// deduced type or the externally-imposed type.
27062706
Type oneWayVarType;
2707-
if (bindPatternVarsOneWay) {
2707+
if (CS.getASTContext().TypeCheckerOpts.DisableOptimizedRestrictions &&
2708+
bindPatternVarsOneWay) {
27082709
oneWayVarType = CS.createTypeVariable(
27092710
CS.getConstraintLocator(locator), TVO_CanBindToNoEscape);
27102711

0 commit comments

Comments
 (0)