Uploaded image for project: 'Swift'
  1. Swift
  2. SR-4196

Allow #if (conditional compilation) to guard switch cases

    XMLWordPrintable

    Details

      Description

      Currently #if can only be used to guard complete declarations or complete statements, due to the (deliberate) modeling as part of the AST rather than as a textual preprocessing step. However, there's one more place where it would structurally make sense to allow #if: switch cases. This may be important if a new case is added in a new version of Swift. Right now you'd have to write the switch twice.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rintaro Rintaro Ishizaki
              Reporter:
              jrose Jordan Rose
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: