DMD currently accepts a switch with no actual body (extracted from a parital
dustmite reduction):
switch( ch )
return ;
As a likely directly related issue, DMD also accepts this, although it
shouldn't:
IRCallingConvention parseCallConvention()
{
// CallConvention
switch(tok)
{
return IRCallingConvention.d;
}
}
Comment #1 by yebblies — 2014-08-23T15:41:20Z
These are unfortunately valid, and relied upon for this:
switch(...) with(...)
{
}
Comment #2 by ibuclaw — 2014-08-23T16:04:09Z
(In reply to yebblies from comment #1)
> These are unfortunately valid, and relied upon for this:
>
> switch(...) with(...)
> {
> }
Any other valid cases? It might seem reasonable to clamp down on just what is accepted. Also accepted code.
switch(ch) with(obj)
return;
Comment #3 by b2.temp — 2021-01-04T00:46:05Z
switch (a)
static foreach (c, list)
case c: mixin(gencodefor!c);
Comment #4 by robert.schadek — 2024-12-13T18:24:42Z