mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
22 lines
1019 B
Swift
22 lines
1019 B
Swift
// RUN: %target-typecheck-verify-swift -swift-version 5 -print-diagnostic-groups
|
|
|
|
extension DefaultStringInterpolation {
|
|
@available(*, deprecated) func appendInterpolation(deprecated: Int) {}
|
|
}
|
|
|
|
// Make sure diagnostics emitted via string interpolations have a reasonable source location
|
|
|
|
_ = "\(deprecated: 42)" // expected-warning@:7 {{'appendInterpolation(deprecated:)' is deprecated [availability_deprecated]}}
|
|
|
|
_ = "hello, world\(deprecated: 42)!!!" // expected-warning@:19 {{'appendInterpolation(deprecated:)' is deprecated [availability_deprecated]}}
|
|
|
|
_ = "\(42)\(deprecated: 42)test\(deprecated: 42)"
|
|
// expected-warning@-1:12 {{'appendInterpolation(deprecated:)' is deprecated [availability_deprecated]}}
|
|
// expected-warning@-2:33 {{'appendInterpolation(deprecated:)' is deprecated [availability_deprecated]}}
|
|
_ = """
|
|
This is a multiline literal with a deprecated interpolation:
|
|
|
|
\(deprecated: 42)
|
|
"""
|
|
// expected-warning@-2:2 {{'appendInterpolation(deprecated:)' is deprecated [availability_deprecated]}}
|