Commit Graph

3 Commits

Author SHA1 Message Date
Hamish Knight
02d2b4aa46 [IDE] Use LookUpConformanceInModule for synthesized extension requirement substitution
The extension may have requirements stating new conformance requirements
that aren't present in the underlying substitution map for the
conforming type.

rdar://152164768
2025-08-13 21:19:07 +01:00
Robert Widmann
d5c226d55f Propagate Qualified Type Printing in Ambiguous Situations In More Cases
Ultimately this is to support the disambiguation of protocol requirements when printing stubs. This allows us to disambiguate the case where two modules declare a nominal type, and when that type appears in a protocol requirement. In such a case, we now fully qualify the types involved.

Fixing this also appears to now be consistently printing module qualification in many more places, hence the updates to the IDE/SourceKit tests.

rdar://72830118
2022-01-25 14:03:11 -08:00
Hamish Knight
be39edfa7b [IDE] Fix superclass constraint handling for extension merging
For a case like:

```
public class C<T> {}
public class D {}

extension C where T : D {
  public func foo() {}
}
```

We would indadvertedly drop the extension for `C`
in the doc info, as the superclass constraint would
fail the `isBindableToSuperclassOf` check.
Instead, map the subject type of the constraint
into the context and check if it could be bound to
the superclass. In the example above, this is
trivially true, but for cases where we're mirroring
a protocol extension onto the type, this will
disregard those that don't fulfil the requirements.

Resolves rdar://76868074
2021-05-06 22:22:17 +01:00