@@ -613,6 +613,31 @@ class EffectsHandlingWalker : public ASTWalker {
613
613
if (!TE->isImplicit ()) {
614
614
recurse = asImpl ().checkType (TE, TE->getTypeRepr (), TE->getInstanceType ());
615
615
}
616
+ } else if (auto KPE = dyn_cast<KeyPathExpr>(E)) {
617
+ for (auto &component : KPE->getComponents ()) {
618
+ switch (component.getKind ()) {
619
+ case KeyPathExpr::Component::Kind::Property:
620
+ case KeyPathExpr::Component::Kind::Subscript: {
621
+ (void )asImpl ().checkDeclRef (KPE, component.getDeclRef (),
622
+ component.getLoc (),
623
+ /* isImplicitlyAsync=*/ false ,
624
+ /* isImplicitlyThrows=*/ false );
625
+ break ;
626
+ }
627
+
628
+ case KeyPathExpr::Component::Kind::TupleElement:
629
+ case KeyPathExpr::Component::Kind::Invalid:
630
+ case KeyPathExpr::Component::Kind::UnresolvedProperty:
631
+ case KeyPathExpr::Component::Kind::UnresolvedSubscript:
632
+ case KeyPathExpr::Component::Kind::OptionalChain:
633
+ case KeyPathExpr::Component::Kind::OptionalWrap:
634
+ case KeyPathExpr::Component::Kind::OptionalForce:
635
+ case KeyPathExpr::Component::Kind::Identity:
636
+ case KeyPathExpr::Component::Kind::DictionaryKey:
637
+ case KeyPathExpr::Component::Kind::CodeCompletion:
638
+ break ;
639
+ }
640
+ }
616
641
}
617
642
// Error handling validation (via checkTopLevelEffects) happens after
618
643
// type checking. If an unchecked expression is still around, the code was
0 commit comments