[SR-6852] Support #if swift(<4.1)
#49401
Labels
compiler control statements
Feature: compiler control statements
compiler
The Swift compiler itself
feature
A feature request or implementation
good first issue
Good for newcomers
#if
Feature → compiler control statements: Conditional compilation blocks
improvement
swift evolution implemented
Flag → feature: A feature that was approved through the Swift evolution process and implemented
Additional Detail from JIRA
md5: d6504962ca1a564793f5327cd6c0afb5
Issue Description:
swift(>=x.y)
is a special compilation condition that controls whether part of a file is even parsed, because the language may change between versions. Because of this, there's a restriction that it can't be combined with other compilation conditions, which still check that the inactive block of the#if
parses correctly. However, there's nothing wrong with `#if !swift(>=4.1)
`, and therefore it would be reasonable to support spelling that directly, `#if swift(<4.1)
`.(Note that it would not make sense to check for
swift(>x.y)
orswift(<=x.y)
, since that makes a statement about future releases rather than present releases. For example, even when 4.1.0 is officially released, that wouldn't preclude another release from the 4.0 branch, 4.0.4.)The text was updated successfully, but these errors were encountered: