Skip to content

Commit d328b1b

Browse files
committed
[CS] Correctly set key path component types
Previously we missed caching component types in one case, and cached the wrong type in another. Make both cases use cacheExprTypes to cache the correct component types.
1 parent ef6a240 commit d328b1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/CSApply.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,7 @@ namespace {
15501550
ctx.Id_dynamicMember, componentLoc,
15511551
components);
15521552
keyPath->resolveComponents(ctx, components);
1553+
cs.cacheExprTypes(keyPath);
15531554
return keyPath;
15541555
}
15551556

@@ -1640,10 +1641,9 @@ namespace {
16401641
componentExpr->setType(ty);
16411642
cs.cacheType(componentExpr);
16421643

1643-
cs.setType(keyPath, 0, ty);
1644-
16451644
keyPath->setParsedPath(componentExpr);
16461645
keyPath->resolveComponents(ctx, components);
1646+
cs.cacheExprTypes(keyPath);
16471647
return keyPath;
16481648
}
16491649

0 commit comments

Comments
 (0)