[swift-evolution] Proposal: Remove the "fallthrough" keyword

Jacopo Andrea Giola swift-evolution at jacopo.giola.org
Sun Dec 6 11:46:16 CST 2015

Well, you caught me, I was thinking of a static analyzer check but for whatever reason my hands typed compiler check. Go figure.

In the static analyzer this check can be feasible? I know is not a memory leak, but at least he can see if the code flow inside a switch with reswitch statements will continue to go around on the same cases.
But this is only my wild guess, without a clue on what a static analyzer can do :)

- Jacopo

> On 06 Dec 2015, at 18:16, Steve Canon <scanon at apple.com> wrote:
>> On Dec 6, 2015, at 4:52 AM, Jacopo Andrea Giola <swift-evolution at jacopo.giola.org>
>> If this proposal is accepted, it must be coupled with a compiler check that the reswitch statements don't introduce an infinite "switch" loop.
> Detecting this in general is solving the halting problem, so such a check isn't actually feasible.  One could warn when termination can't be proved, but making it a hard error would remove much of the usefulness for implementing interpreters.
> - Steve

More information about the swift-evolution mailing list