Skip to content

Commit 19fc665

Browse files
committed
[CSSyntaticElement] Canonicalize type before collecting "in scope" variables
Follow-up to #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.
1 parent 6b3a17b commit 19fc665

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/CSSyntacticElement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class TypeVariableRefFinder : public ASTWalker {
217217
// For example `Typealias<$T, $U>.Context` which desugars into
218218
// `_Context<$U>` would bring in `$T` that could be inferrable
219219
// only after the body of the closure is solved.
220-
type = type->getDesugaredType();
220+
type = type->getCanonicalType();
221221

222222
// Don't walk into the opaque archetypes because they are not
223223
// transparent in this context - `some P` could reference a

0 commit comments

Comments
 (0)