Skip to content

Frontend: Reinstate suppression of warnings during interface type-checking #80415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/Frontend/ModuleInterfaceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,13 +1741,11 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
genericSubInvocation.setRuntimeResourcePath(SearchPathOpts.RuntimeResourcePath);
}

// Inhibit warnings from the genericSubInvocation since we are assuming the user
// is not in a position to address them. (Unless we're verifying, in which
// case they might.)
if (requestedAction != FrontendOptions::ActionType::Typecheck) {
genericSubInvocation.getDiagnosticOptions().SuppressWarnings = true;
GenericArgs.push_back("-suppress-warnings");
}
// Inhibit warnings from the genericSubInvocation since we are assuming the
// user is not in a position to address them.
genericSubInvocation.getDiagnosticOptions().SuppressWarnings = true;
GenericArgs.push_back("-suppress-warnings");

// Inherit the parent invocation's setting on whether to suppress remarks
if (suppressRemarks) {
genericSubInvocation.getDiagnosticOptions().SuppressRemarks = true;
Expand Down
2 changes: 1 addition & 1 deletion test/ModuleInterface/has_storage_attr_bad.swiftinterface
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
// REQUIRES: OS=macosx

extension Array {
@_hasStorage public var foo: Int { get set } // expected-warning {{'@_hasStorage' attribute cannot be applied to declaration in extension}}
@_hasStorage public var foo: Int { get set }
}