Skip to content

Commit 4a30620

Browse files
authored
Merge pull request #5434 from DougGregor/minor-solver-tweaks
2 parents ad3a9f2 + d790291 commit 4a30620

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ getCalleeDeclAndArgs(ConstraintSystem &cs,
602602
// References to instance members on a metatype stay at level 0.
603603
// Everything else is level 1.
604604
if (!(function->isInstanceMember() &&
605-
cs.simplifyType(choice->getBaseType())->is<AnyMetatypeType>()))
605+
cs.getFixedTypeRecursive(choice->getBaseType(),
606+
/*wantRValue=*/true)
607+
->is<AnyMetatypeType>()))
606608
level = 1;
607609
} else if (isa<SubscriptDecl>(decl)) {
608610
// Subscript level 1 == the indices.

lib/Sema/CSSolver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,9 @@ static PotentialBindings getPotentialBindings(ConstraintSystem &cs,
780780

781781
case ConstraintKind::Defaultable:
782782
// Do these in a separate pass.
783-
defaultableConstraints.push_back(constraint);
783+
if (cs.getFixedTypeRecursive(constraint->getFirstType(), true)
784+
->getAs<TypeVariableType>() == typeVar)
785+
defaultableConstraints.push_back(constraint);
784786
continue;
785787

786788
case ConstraintKind::Disjunction:

0 commit comments

Comments
 (0)