Skip to content

Commit d4f92d4

Browse files
authored
Merge pull request swiftlang#35527 from CodaFi/context-clues
Use the Correct DeclContext When Simplifying Member Constraints
2 parents b689338 + 0943351 commit d4f92d4

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
@@ -7490,11 +7490,11 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
74907490
if (!paramDecl)
74917491
continue;
74927492

7493-
auto descriptor = UnqualifiedLookupDescriptor(
7493+
auto descriptor = UnqualifiedLookupDescriptor{
74947494
DeclNameRef(param->getName()),
7495-
paramDecl->getDeclContext()->getParentSourceFile(),
7495+
paramDecl->getDeclContext()->getModuleScopeContext(),
74967496
SourceLoc(),
7497-
UnqualifiedLookupFlags::TypeLookup);
7497+
UnqualifiedLookupFlags::TypeLookup};
74987498
auto lookup = evaluateOrDefault(
74997499
Context.evaluator, UnqualifiedLookupRequest{descriptor}, {});
75007500
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)