@@ -651,15 +651,23 @@ ASTWalker::PreWalkAction SemaAnnotator::walkToTypeReprPre(TypeRepr *T) {
651651 return Action::StopIf (!Continue);
652652 }
653653 } else if (auto FT = dyn_cast<FixedTypeRepr>(T)) {
654- ValueDecl *VD = FT->getType ()->getAnyGeneric ();
655- if (auto DT = FT->getType ()->getAs <DynamicSelfType>())
654+ if (ValueDecl *VD = FT->getType ()->getAnyGeneric ()) {
655+ auto Data = ReferenceMetaData (SemaReferenceKind::TypeRef, None);
656+ Data.isImplicitCtorType = true ;
657+ auto Continue = passReference (VD, FT->getType (), FT->getLoc (),
658+ FT->getSourceRange (), Data);
659+ return Action::StopIf (!Continue);
660+ }
661+ } else if (auto ST = dyn_cast<SelfTypeRepr>(T)) {
662+ ValueDecl *VD = ST->getType ()->getAnyGeneric ();
663+ if (auto DT = ST->getType ()->getAs <DynamicSelfType>())
656664 VD = DT->getSelfType ()->getAnyGeneric ();
657665
658666 if (VD) {
659667 auto Data = ReferenceMetaData (SemaReferenceKind::TypeRef, llvm::None);
660668 Data.isImplicitCtorType = true ;
661- auto Continue = passReference (VD, FT ->getType (), FT ->getLoc (),
662- FT ->getSourceRange (), Data);
669+ auto Continue = passReference (VD, ST ->getType (), ST ->getLoc (),
670+ ST ->getSourceRange (), Data);
663671 return Action::StopIf (!Continue);
664672 }
665673 }
0 commit comments