mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
21 lines
669 B
Swift
21 lines
669 B
Swift
// Parse-only modes, like swift -parse and SourceKit, should not emit strange
|
|
// interpolation errors in `#if swift(>=5)` blocks
|
|
// (https://github.com/apple/swift/issues/52343).
|
|
//
|
|
// Even though this is in the test/SourceKit directory, it also tests
|
|
// -frontend -parse behavior because the test cases are exactly the same.
|
|
|
|
// RUN: %sourcekitd-test -req=open %s -- -swift-version 4.2 %s == -req=print-diags %s | %FileCheck %s
|
|
// RUN: %target-swift-frontend -parse -verify -swift-version 4.2 %s
|
|
|
|
let x = 1
|
|
|
|
// We should not warn in blocks that can only run when `swift(>=5.0)`.
|
|
|
|
#if swift(>=5.0)
|
|
print("[\(foo: x)]")
|
|
print("[\(x, x)]")
|
|
#endif
|
|
|
|
// CHECK: <<NULL>>
|