mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: Honor warning suppression when parsing arguments from swiftinterfaces.
Diagnostics are suppressed when parsing swiftinterface files, since the warnings emitted from compiling the swiftinterface of a dependency would just be a nuisance. It follows that warnings generated when parsing the arguments in a swiftinterface file should also be suppressed, but that wasn't happening because the diagnostic engine of the main compile was used for parsing. Pass the diagnostic engine of the compiler subinstance instead, and proactively suppress warnings before parsing begins. Resolves rdar://142814164.
This commit is contained in:
7
test/ModuleInterface/suppress-warnings.swift
Normal file
7
test/ModuleInterface/suppress-warnings.swift
Normal file
@@ -0,0 +1,7 @@
|
||||
// RUN: %target-swift-frontend -compile-module-from-interface %S/Inputs/suppress-warnings/SuppressWarnings.swiftinterface -o /dev/null -module-name SuppressWarnings 2>&1 | %FileCheck %s --allow-empty
|
||||
// RUN: %target-swift-frontend -typecheck %s -I %S/Inputs/suppress-warnings/ 2>&1 | %FileCheck %s --allow-empty
|
||||
|
||||
// Warnings should not be emitted when compiling SuppressWarnings from its interface
|
||||
// CHECK-NOT: warning
|
||||
|
||||
import SuppressWarnings
|
||||
Reference in New Issue
Block a user