mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Unified across module-wide configuration flags (`-Wwarning`, `-Werror`, etc.) and syntactic configuration attribute `@warn`.
16 lines
415 B
Swift
16 lines
415 B
Swift
// REQUIRES: swift_feature_SourceWarningControl
|
|
// RUN: %target-typecheck-verify-swift -enable-experimental-feature SourceWarningControl
|
|
|
|
@available(*, deprecated)
|
|
func bar() -> [Int] { return [1,2,3] }
|
|
|
|
@warn(DeprecatedDeclaration, as: error)
|
|
func foo() -> [Int] {
|
|
return bar() // expected-error {{'bar()' is deprecated}}
|
|
}
|
|
|
|
@warn(DeprecatedDeclaration, as: ignored)
|
|
func baz() -> [Int] {
|
|
return bar()
|
|
}
|