mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use the Correct DeclContext When Simplifying Member Constraints
Looking for the parent source file is going to fail when the paramter we're interested in comes from a module context. Request the correct top-level context in those situations. rdar://73379770
This commit is contained in:
@@ -7478,11 +7478,11 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
|
|||||||
if (!paramDecl)
|
if (!paramDecl)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto descriptor = UnqualifiedLookupDescriptor(
|
auto descriptor = UnqualifiedLookupDescriptor{
|
||||||
DeclNameRef(param->getName()),
|
DeclNameRef(param->getName()),
|
||||||
paramDecl->getDeclContext()->getParentSourceFile(),
|
paramDecl->getDeclContext()->getModuleScopeContext(),
|
||||||
SourceLoc(),
|
SourceLoc(),
|
||||||
UnqualifiedLookupFlags::TypeLookup);
|
UnqualifiedLookupFlags::TypeLookup};
|
||||||
auto lookup = evaluateOrDefault(
|
auto lookup = evaluateOrDefault(
|
||||||
Context.evaluator, UnqualifiedLookupRequest{descriptor}, {});
|
Context.evaluator, UnqualifiedLookupRequest{descriptor}, {});
|
||||||
for (auto &result : lookup) {
|
for (auto &result : lookup) {
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// RUN: not %target-swift-frontend -typecheck %s
|
||||||
|
|
||||||
|
typealias IndexResult = Result<Bol, Error>
|
||||||
|
extension IndexResult {
|
||||||
|
func perfect() -> Self {
|
||||||
|
Success(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user