Skip to content

Commit d4a4540

Browse files
committed
RequirementMachine: Fix name lookups for the internal 'where' clause of a GenericParamList
These come up in SIL and in the experimental named opaque result types implementation. Pass the correct DeclContext here, instead of using the ModuleDecl.
1 parent 2d066dd commit d4a4540

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/AST/RequirementMachine/RequirementMachineRequests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,14 @@ InferredGenericSignatureRequestRQM::evaluate(
485485
requirements);
486486
}
487487

488+
auto *lookupDC = (*gpList->begin())->getDeclContext();
489+
488490
// Add the generic parameter list's 'where' clause to the builder.
489491
//
490492
// The only time generic parameter lists have a 'where' clause is
491493
// in SIL mode; all other generic declarations have a free-standing
492494
// 'where' clause, which will be visited below.
493-
WhereClauseOwner(parentModule, gpList)
495+
WhereClauseOwner(lookupDC, gpList)
494496
.visitRequirements(TypeResolutionStage::Structural,
495497
visitRequirement);
496498
}

0 commit comments

Comments
 (0)