Skip to content

Commit deea221

Browse files
authored
Merge pull request #22279 from xedin/rdar-47492691-5.0
[5.0][ConstraintSystem] Decouple `designated types` feature from Swift ver…
2 parents c01aa61 + 4f4fcf6 commit deea221

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,9 +1956,10 @@ Constraint *ConstraintSystem::selectDisjunction() {
19561956
// disjunctions that we may not be able to short-circuit, allowing
19571957
// us to eliminate behavior that is exponential in the number of
19581958
// operators in the expression.
1959-
if (getASTContext().isSwiftVersionAtLeast(5))
1959+
if (TC.getLangOpts().SolverEnableOperatorDesignatedTypes) {
19601960
if (auto *disjunction = selectApplyDisjunction())
19611961
return disjunction;
1962+
}
19621963

19631964
if (auto *disjunction = selectBestBindingDisjunction(*this, disjunctions))
19641965
return disjunction;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-typecheck-verify-swift
2+
// REQUIRES: objc_interop
3+
4+
import CoreGraphics
5+
import simd
6+
7+
func test(foo: CGFloat, bar: CGFloat) {
8+
_ = CGRect(x: 0.0 + 1.0, y: 0.0 + foo, width: 3.0 - 1 - 1 - 1.0, height: bar)
9+
}

0 commit comments

Comments
 (0)