File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -3456,6 +3456,12 @@ static bool declNeedsExplicitAvailability(const Decl *decl) {
34563456 if (!ctx.supportsVersionedAvailability ())
34573457 return false ;
34583458
3459+ // Don't enforce explicit availability requirements in .swiftinterface files.
3460+ // These diagnostics are only designed to be emitted when building from
3461+ // source.
3462+ if (decl->getDeclContext ()->isInSwiftinterface ())
3463+ return false ;
3464+
34593465 // Skip non-public decls.
34603466 if (auto valueDecl = dyn_cast<const ValueDecl>(decl)) {
34613467 AccessScope scope =
Original file line number Diff line number Diff line change 1+ // -require-explicit-availability is not printed in interfaces, so no warnings
2+ // should be emitted when verifying the interface.
3+ // RUN: %target-swift-emit-module-interface(%t_require.swiftinterface) -require-explicit-availability=warn %s
4+ // RUN: %target-swift-typecheck-module-from-interface(%t_require.swiftinterface) -verify
5+
6+ // -library-level=api implies -require-explicit-availability=warn and it _is_
7+ // printed in the interface. Still, no diagnostics about required explicit
8+ // availability should be emitted when verifying the interface.
9+ // RUN: %target-swift-emit-module-interface(%t_api.swiftinterface) -library-level=api %s
10+ // RUN: %target-swift-typecheck-module-from-interface(%t_api.swiftinterface) -verify
11+
12+ public struct NoAvailability { }
You can’t perform that action at this time.
0 commit comments