Commit Graph

2 Commits

Author SHA1 Message Date
Slava Pestov
9695b1957a RequirementMachine: Concrete contraction needs to substitute the parent type of a subject type sometimes
If you have generic parameters <T, U> and requirements of the form:

- T : P
- T == ConcreteType<U>
- T.[P]U : SomeClass
- T.[P]U : SomeProto

And furthermore SomeClass does not conform to SomeProto, we can't leave
`T.[P]U : SomeClass` unsubstituted; we still have to replace `T` with
`ConcreteType<U>` to transform the latter two requirements into:

- U : SomeClass
- U : SomeProto

"Concrete contraction" is easily the hackiest part of the Requirement
Machine; I need to come up with a more principled solution for the
problem that it solves sooner or later.

Fixes rdar://problem/94150249.
2022-06-08 00:40:30 -04:00
Slava Pestov
c37a4ba235 Sema: Eagerly resolve typealiases in protocol extensions in ::Structural mode
We resolve protocol typealiases to DependentMemberTypes because the
Requirement Machine treats them as rewrite rules. However, it doesn't
do this for typealiases in protocol extensions.

Fixes rdar://problem/94150249.
2022-06-07 22:59:28 -04:00