This has been brought up on this list before. The conclusion of the
previous thread on this topic was that there is a way to do this:

#if false
// put your code here
#endif

It does not allow you to comment out fragments of a single statement, but
the incremental value of devoting time to additionally support that is, it
would seem, low.

On Sat, Jan 14, 2017 at 17:18 Amir Michail via swift-evolution <
[email protected]> wrote:

> The code in a “code comment" must compile (not just be syntactically
> correct) yet must not have any effect on the resulting executable.
>
> For example, commented entries in an array would be checked for
> compilability but would not be included in the executable.
>
> Such “code comments" would allow you to have code/data that is currently
> unused but is constantly checked to be valid just in case you want to use
> it in the future.
>
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to