[CS] Only use unsolved applicable fn for @dynamicMemberLookup cases

This works around the fact that existential opening does not currently
work correctly in cases where the argument isn't resolved before the
applicable fn is solved.
This commit is contained in:
Hamish Knight
2025-10-19 13:14:00 +01:00
parent 9147adc7d5
commit 0a1905acba
4 changed files with 67 additions and 10 deletions

View File

@@ -601,3 +601,18 @@ struct TestIssue56837 {
_ = value[type: Int8.max]
}
}
@dynamicMemberLookup
class TestDynamicSelf {
struct S {
subscript() -> Int { 0 }
}
func foo() -> Self {
// Make sure we can do dynamic member lookup on a dynamic self.
_ = self[]
return self
}
subscript<T>(dynamicMember dynamicMember: KeyPath<S, T>) -> T {
fatalError()
}
}