Commit Graph

2 Commits

Author SHA1 Message Date
Pavel Yaskevich
976c0b17c3 [CSSyntaticElement] Canonicalize type before collecting "in scope" variables
Follow-up to https://github.com/apple/swift/pull/65048

`getDesugaredType` unwraps sugar types that appear in sequence,
to remove sugar from nested positions we need to get a canonical type.

Thanks to @slavapestov for pointing it out.
2023-04-11 11:53:31 -07:00
Pavel Yaskevich
ca14ab7157 [CSSyntaticElement] Desugar types before collecting "in scope" type variables
Generic type aliases, unless desugared, could bring unrelated type variables
into the scope i.e. `TypeAlias<$T, $U>.Context` is actually `_Context<$U>`.
These variables could be inferrable only after the the body the closure is
solved. To avoid that, let's adjust `TypeVariableRefFinder` to desugar types
before collecting referenced type variables.

Resolves: rdar://107835060
2023-04-10 15:33:03 -07:00