@@ -5055,7 +5055,7 @@ bool MissingGenericArgumentsFailure::diagnoseForAnchor(
5055
5055
5056
5056
bool MissingGenericArgumentsFailure::diagnoseParameter (
5057
5057
Anchor anchor, GenericTypeParamType *GP) const {
5058
- auto &cs = getConstraintSystem ();
5058
+ auto &solution = getSolution ();
5059
5059
5060
5060
auto loc = anchor.is <Expr *>() ? anchor.get <Expr *>()->getLoc ()
5061
5061
: anchor.get <TypeRepr *>()->getLoc ();
@@ -5065,7 +5065,7 @@ bool MissingGenericArgumentsFailure::diagnoseParameter(
5065
5065
// going to be completely cut off from the rest of constraint system,
5066
5066
// that's why we'd get two fixes in this case which is not ideal.
5067
5067
if (locator->isForContextualType () &&
5068
- llvm::count_if (cs .DefaultedConstraints ,
5068
+ llvm::count_if (solution .DefaultedConstraints ,
5069
5069
[&GP](const ConstraintLocator *locator) {
5070
5070
return locator->getGenericParameter () == GP;
5071
5071
}) > 1 ) {
@@ -5105,7 +5105,7 @@ bool MissingGenericArgumentsFailure::diagnoseParameter(
5105
5105
5106
5106
void MissingGenericArgumentsFailure::emitGenericSignatureNote (
5107
5107
Anchor anchor) const {
5108
- auto &cs = getConstraintSystem ();
5108
+ auto &solution = getSolution ();
5109
5109
auto *paramDC = getDeclContext ();
5110
5110
5111
5111
if (!paramDC)
@@ -5123,7 +5123,9 @@ void MissingGenericArgumentsFailure::emitGenericSignatureNote(
5123
5123
};
5124
5124
5125
5125
llvm::SmallDenseMap<GenericTypeParamDecl *, Type> params;
5126
- for (auto *typeVar : cs.getTypeVariables ()) {
5126
+ for (auto &entry : solution.typeBindings ) {
5127
+ auto *typeVar = entry.first ;
5128
+
5127
5129
auto *GP = typeVar->getImpl ().getGenericParameter ();
5128
5130
if (!GP)
5129
5131
continue ;
@@ -5133,7 +5135,7 @@ void MissingGenericArgumentsFailure::emitGenericSignatureNote(
5133
5135
5134
5136
// If this is one of the defaulted parameter types, attempt
5135
5137
// to emit placeholder for it instead of `Any`.
5136
- if (llvm::any_of (cs .DefaultedConstraints ,
5138
+ if (llvm::any_of (solution .DefaultedConstraints ,
5137
5139
[&](const ConstraintLocator *locator) {
5138
5140
return GP->getDecl () == getParamDecl (locator);
5139
5141
}))
0 commit comments