[SourceKit] Allow generation of cursor info for declarations from solutions that haven’t aren’t applied to the AST ye

This has two benefits:
1. We can now report ambiguous variable types
2. We are more robust in the generation of results for declarations inside closures. If the closure has an error, we won’t apply the solution to the AST and thus any cursor info that tried to get types out of the AST would fail.

rdar://123845208
This commit is contained in:
Alex Hoppen
2024-03-15 20:48:00 -07:00
parent 4c5558d482
commit ef3e1c1d4f
8 changed files with 182 additions and 66 deletions

View File

@@ -178,7 +178,7 @@ ASTWalker::PreWalkAction SemaAnnotator::walkToDeclPreProper(Decl *D) {
SourceLoc loc = parsedName.second;
if (auto assocTypeDecl = proto->getAssociatedType(name)) {
auto Continue = passReference(
assocTypeDecl, assocTypeDecl->getDeclaredInterfaceType(),
assocTypeDecl, assocTypeDecl->getInterfaceType(),
DeclNameLoc(loc),
ReferenceMetaData(SemaReferenceKind::TypeRef, std::nullopt));
if (!Continue)