mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Attach Lazy ClangImporter Diagnostics as Notes
Clang importer diagnostics that are produced as a result of a reference in Swift code are attached to as notes to the Sema produced diagnostic that indicates the declaration is unavailable. Ex: Notes about why a C function import failed are attached to the error explaining that the symbol could not be found in scope.
This commit is contained in:
@@ -3626,6 +3626,11 @@ bool MissingMemberFailure::diagnoseAsError() {
|
||||
emitDiagnostic(diagnostic, baseType, getName())
|
||||
.highlight(getSourceRange())
|
||||
.highlight(nameLoc.getSourceRange());
|
||||
const auto &ctx = getSolution().getDC()->getASTContext();
|
||||
if (ctx.LangOpts.EnableExperimentalClangImporterDiagnostics) {
|
||||
ctx.getClangModuleLoader()->diagnoseMemberValue(getName().getFullName(),
|
||||
baseType);
|
||||
}
|
||||
};
|
||||
|
||||
TypoCorrectionResults corrections(getName(), nameLoc);
|
||||
|
||||
Reference in New Issue
Block a user