mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Begin accepting `-swift-version 7` in asserts compilers so that we can begin to test source-breaking changes intended for the next language version mode, such as diagnostics that need to be staged in without breaking existing code. There are no announced plans yet for a language mode after Swift 6, so 7 serves as a placeholder for some future language mode. Tests that wish to use `-swift-version 7` currently must be marked with `REQUIRES: swift7` or they will fail in no-asserts bots. The simplest pattern is probably to duplicate part or all of the pre-Swift 7 test to check that will behave as intended in Swift 7.
45 lines
757 B
Swift
45 lines
757 B
Swift
// RUN: not %target-swiftc_driver -swift-version 7 -typecheck %s 2>&1 | %FileCheck --check-prefix ERROR_7 %s
|
|
// REQUIRES: swift7
|
|
|
|
#if swift(>=3)
|
|
asdf
|
|
// ERROR_7: [[@LINE-1]]:1: error: {{cannot find 'asdf' in scope}}
|
|
#else
|
|
jkl
|
|
#endif
|
|
|
|
#if swift(>=3.1)
|
|
asdf
|
|
// ERROR_7: [[@LINE-1]]:1: error: {{cannot find 'asdf' in scope}}
|
|
#else
|
|
jkl
|
|
#endif
|
|
|
|
#if swift(>=4)
|
|
asdf
|
|
// ERROR_7: [[@LINE-1]]:1: error: {{cannot find 'asdf' in scope}}
|
|
#else
|
|
jkl
|
|
#endif
|
|
|
|
#if swift(>=4.1)
|
|
asdf
|
|
// ERROR_7: [[@LINE-1]]:1: error: {{cannot find 'asdf' in scope}}
|
|
#else
|
|
jkl
|
|
#endif
|
|
|
|
#if swift(>=6)
|
|
asdf
|
|
// ERROR_7: [[@LINE-1]]:1: error: {{cannot find 'asdf' in scope}}
|
|
#else
|
|
jkl
|
|
#endif
|
|
|
|
#if swift(>=7)
|
|
asdf
|
|
// ERROR_7: [[@LINE-1]]:1: error: {{cannot find 'asdf' in scope}}
|
|
#else
|
|
jkl
|
|
#endif
|