Files
swift-mirror/test/attr/diagnose.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

15 lines
325 B
Swift

// RUN: %target-typecheck-verify-swift
@available(*, deprecated)
func bar() -> [Int] { return [1,2,3] }
@diagnose(DeprecatedDeclaration, as: error)
func foo() -> [Int] {
return bar() // expected-error {{'bar()' is deprecated}}
}
@diagnose(DeprecatedDeclaration, as: ignored)
func baz() -> [Int] {
return bar()
}