Files
swift-mirror/test/ModuleInterface/diagnose_attr.swift
Artem Chikin 740800dd21 [SourceWarningControl] Promote '@diagnose' attribute to a default language feature
No longer experimental as of approval of SE-0522.

Resolves rdar://176535491
2026-05-08 09:59:11 +01:00

29 lines
960 B
Swift

// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name DiagnoseAttrTest
// 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 {}