Skip to content

Commit 5437959

Browse files
authored
Merge pull request #67273 from apple/block-list-note-5.9
2 parents 3b2fdd1 + 0be9780 commit 5437959

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,10 @@ ERROR(need_cxx_interop_to_import_module,none,
881881
NOTE(enable_cxx_interop_docs,none,
882882
"visit https://www.swift.org/documentation/cxx-interop/project-build-setup to learn how to enable C++ interoperability", ())
883883

884+
NOTE(interface_block_listed_broken,none,
885+
"textual interface for %0 is blocklisted as broken; "
886+
"interface verification errors are downgraded to warnings", (StringRef))
887+
884888
ERROR(reserved_member_name,none,
885889
"type member must not be named %0, since it would conflict with the"
886890
" 'foo.%1' expression", (DeclName, StringRef))

lib/Frontend/ModuleInterfaceBuilder.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,14 @@ bool ExplicitModuleInterfaceBuilder::collectDepsForSerialization(
183183

184184
static bool shouldDowngradeInterfaceVerificationError(const FrontendOptions &opts,
185185
ASTContext &ctx) {
186-
return opts.DowngradeInterfaceVerificationError ||
187-
ctx.blockListConfig.hasBlockListAction(opts.ModuleName,
188-
BlockListKeyKind::ModuleName,
189-
BlockListAction::DowngradeInterfaceVerificationFailure);
186+
if (ctx.blockListConfig.hasBlockListAction(opts.ModuleName,
187+
BlockListKeyKind::ModuleName,
188+
BlockListAction::DowngradeInterfaceVerificationFailure)) {
189+
ctx.Diags.diagnose(SourceLoc(), diag::interface_block_listed_broken,
190+
opts.ModuleName);
191+
return true;
192+
}
193+
return opts.DowngradeInterfaceVerificationError;
190194
}
191195

192196
std::error_code ExplicitModuleInterfaceBuilder::buildSwiftModuleFromInterface(

test/ModuleInterface/blocklist_action.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@
1818
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -downgrade-typecheck-interface-error
1919
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -blocklist-file %t/blocklist.yml
2020

21+
// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test -blocklist-file %t/blocklist.yml &> %t/notes.txt
22+
// RUN: %FileCheck -check-prefix CHECK-NOTES --input-file %t/notes.txt %s
23+
// CHECK-NOTES: note: textual interface for Test is blocklisted as broken; interface verification errors are downgraded to warnings
24+
2125
public func foo() {}

0 commit comments

Comments
 (0)