Skip to content

Commit 8c8ed34

Browse files
authored
Merge pull request #80415 from tshortli/suppress-warnings-when-typechecking-module-interfaces
Frontend: Reinstate suppression of warnings during interface type-checking
2 parents 239bca9 + 645628f commit 8c8ed34

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -1741,13 +1741,11 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
17411741
genericSubInvocation.setRuntimeResourcePath(SearchPathOpts.RuntimeResourcePath);
17421742
}
17431743

1744-
// Inhibit warnings from the genericSubInvocation since we are assuming the user
1745-
// is not in a position to address them. (Unless we're verifying, in which
1746-
// case they might.)
1747-
if (requestedAction != FrontendOptions::ActionType::Typecheck) {
1748-
genericSubInvocation.getDiagnosticOptions().SuppressWarnings = true;
1749-
GenericArgs.push_back("-suppress-warnings");
1750-
}
1744+
// Inhibit warnings from the genericSubInvocation since we are assuming the
1745+
// user is not in a position to address them.
1746+
genericSubInvocation.getDiagnosticOptions().SuppressWarnings = true;
1747+
GenericArgs.push_back("-suppress-warnings");
1748+
17511749
// Inherit the parent invocation's setting on whether to suppress remarks
17521750
if (suppressRemarks) {
17531751
genericSubInvocation.getDiagnosticOptions().SuppressRemarks = true;

test/ModuleInterface/has_storage_attr_bad.swiftinterface

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
// REQUIRES: OS=macosx
66

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

0 commit comments

Comments
 (0)