Fix missing indexing data when using Self initializer

Fixes: https://github.com/apple/swift/issues/64686
This commit is contained in:
Keith Smiley
2023-04-28 14:26:01 -07:00
parent bfe975d5f8
commit 1d3a9baed2
5 changed files with 81 additions and 4 deletions

View File

@@ -633,6 +633,18 @@ ASTWalker::PreWalkAction SemaAnnotator::walkToTypeReprPre(TypeRepr *T) {
ReferenceMetaData(SemaReferenceKind::TypeRef, None));
return Action::StopIf(!Continue);
}
} else if (auto FT = dyn_cast<FixedTypeRepr>(T)) {
ValueDecl *VD = FT->getType()->getAnyGeneric();
if (auto DT = FT->getType()->getAs<DynamicSelfType>())
VD = DT->getSelfType()->getAnyGeneric();
if (VD) {
auto Data = ReferenceMetaData(SemaReferenceKind::TypeRef, None);
Data.isImplicitCtorType = true;
auto Continue = passReference(VD, FT->getType(), FT->getLoc(),
FT->getSourceRange(), Data);
return Action::StopIf(!Continue);
}
}
return Action::Continue();