mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
Merge pull request #88205 from artemcm/DiagnoseAttr
[Source Warning Control] Rename `@warn` to `@diagnose` & prevent printing it in Textual Interfaces
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// REQUIRES: swift_feature_SourceWarningControl
|
||||
|
||||
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name DiagnoseAttrTest \
|
||||
// RUN: -enable-experimental-feature SourceWarningControl
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name DiagnoseAttrTest
|
||||
// RUN: %FileCheck %s < %t.swiftinterface
|
||||
|
||||
// The @diagnose attribute should not appear anywhere in the interface.
|
||||
// CHECK-NOT: @diagnose
|
||||
// CHECK: public func usesAsDiagnoseWarning() -> Swift
|
||||
// CHECK-NOT: @diagnose
|
||||
// CHECK: public func usesAsDiagnoseIgnored() -> Swift
|
||||
// CHECK-NOT: @diagnose
|
||||
// CHECK: public struct DiagnoseOnType {
|
||||
// CHECK-NOT: @diagnose
|
||||
|
||||
@available(*, deprecated)
|
||||
public func deprecatedFunc() -> Int { return 0 }
|
||||
|
||||
@diagnose(DeprecatedDeclaration, as: warning)
|
||||
public func usesAsDiagnoseWarning() -> Int {
|
||||
return deprecatedFunc()
|
||||
}
|
||||
|
||||
@diagnose(DeprecatedDeclaration, as: ignored)
|
||||
public func usesAsDiagnoseIgnored() -> Int {
|
||||
return deprecatedFunc()
|
||||
}
|
||||
|
||||
@diagnose(DeprecatedDeclaration, as: ignored)
|
||||
public struct DiagnoseOnType {}
|
||||
Reference in New Issue
Block a user