Skip to content

Commit 223e409

Browse files
authored
Merge pull request swiftlang#35533 from CodaFi/con-forma-session
[5.4] Use the Correct DeclContext When Simplifying Member Constraints
2 parents d864e95 + 5350b96 commit 223e409

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7472,11 +7472,11 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
74727472
if (!paramDecl)
74737473
continue;
74747474

7475-
auto descriptor = UnqualifiedLookupDescriptor(
7475+
auto descriptor = UnqualifiedLookupDescriptor{
74767476
DeclNameRef(param->getName()),
7477-
paramDecl->getDeclContext()->getParentSourceFile(),
7477+
paramDecl->getDeclContext()->getModuleScopeContext(),
74787478
SourceLoc(),
7479-
UnqualifiedLookupFlags::TypeLookup);
7479+
UnqualifiedLookupFlags::TypeLookup};
74807480
auto lookup = evaluateOrDefault(
74817481
Context.evaluator, UnqualifiedLookupRequest{descriptor}, {});
74827482
for (auto &result : lookup) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
typealias IndexResult = Result<Bol, Error>
4+
extension IndexResult {
5+
func perfect() -> Self {
6+
Success(true)
7+
}
8+
}

0 commit comments

Comments
 (0)