Skip to content

[NFC] Clarify comments for SR-15843 #41532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/Sema/ConstraintSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3710,8 +3710,7 @@ static bool diagnoseConflictingGenericArguments(ConstraintSystem &cs,
llvm::SmallDenseMap<TypeVariableType *,
std::pair<GenericTypeParamType *, SourceLoc>, 4>
genericParams;
// Consider only representative type variables shared across
// all of the solutions.
// Consider all representative type variables across all solutions.
for (auto &solution : solutions) {
for (auto &typeBinding : solution.typeBindings) {
auto *typeVar = typeBinding.first;
Expand Down Expand Up @@ -3748,10 +3747,9 @@ static bool diagnoseConflictingGenericArguments(ConstraintSystem &cs,
for (const auto &solution : solutions) {
auto type = solution.typeBindings.lookup(typeVar);
// Type variables gathered from a solution's type binding context may not
// exist in another given solution because each solution could have a
// different set of overload choices picked, which implies that some of
// the generic parameters, and type variables that represent them, would
// be unique to that solution.
// exist in another given solution because some solutions may have
// additional type variables not present in other solutions due to taking
// different paths in the solver.
if (!type)
continue;

Expand Down