File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -14753,8 +14753,15 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1475314753 // means that result would attempt a type from each side if
1475414754 // one is available and that would result in two fixes - one for
1475514755 // each mismatched branch.
14756- if (branchElt->forElse())
14756+ if (branchElt->forElse()) {
1475714757 impact = 10;
14758+ } else {
14759+ // Also increase impact for `then` branch lower than `else` to still
14760+ // eliminate ambiguity, but slightly worst than the average fix to avoid
14761+ // so the solution which record this fix wouldn't be picked over one
14762+ // that has contextual mismatch fix on the result of ternary expression.
14763+ impact = 5;
14764+ }
1475814765 }
1475914766 using SingleValueStmtBranch = LocatorPathElt::SingleValueStmtBranch;
1476014767 if (auto branchElt = locator->getLastElementAs<SingleValueStmtBranch>()) {
Original file line number Diff line number Diff line change @@ -951,3 +951,7 @@ let _ = "foo \(42 /*
951951// expected-error @-3 {{cannot find ')' to match opening '(' in string interpolation}} expected-error @-3 {{unterminated string literal}}
952952// expected-error @-2 {{expected expression}}
953953// expected-error @-3 {{unterminated string literal}}
954+
955+ // https://github.com/apple/swift/issues/66192
956+ func I66192 ( _: Int) { }
957+ I66192( true ? " yes " : " no " ) // expected-error{{cannot convert value of type 'String' to expected argument type 'Int'}}
You can’t perform that action at this time.
0 commit comments