Skip to content

Commit d0190a5

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents 9eeb661 + 9121f45 commit d0190a5

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

lib/AST/ASTScopeCreation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ void PatternEntryDeclScope::beCurrent() {
17881788
unsigned varCount = 0;
17891789
getPatternEntry().getPattern()->forEachVariable(
17901790
[&](VarDecl *) { ++varCount; });
1791-
varCountWhenLastExpanded = 0;
1791+
varCountWhenLastExpanded = varCount;
17921792
}
17931793
bool PatternEntryDeclScope::isCurrent() const {
17941794
if (initWhenLastExpanded != getPatternEntry().getOriginalInit())

lib/Sema/CSSimplify.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,6 +1924,10 @@ ConstraintSystem::matchExistentialTypes(Type type1, Type type2,
19241924
// with overloaded declarations.
19251925
if (last->getKind() == ConstraintLocator::ApplyArgToParam)
19261926
return getTypeMatchFailure(locator);
1927+
} else { // There are no elements in the path
1928+
auto *anchor = locator.getAnchor();
1929+
if (!(anchor && isa<AssignExpr>(anchor)))
1930+
return getTypeMatchFailure(locator);
19271931
}
19281932

19291933
auto *fix = MissingConformance::forContextual(
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
protocol Foo {}
4+
func foo(_ bar: Foo) {}
5+
foo(true ? "a" : "b")

0 commit comments

Comments
 (0)