Re: shouldn't this code at least trigger a warning?

2015-04-30 Thread ketmar via Digitalmars-d-learn
On Wed, 29 Apr 2015 07:57:07 -0700, H. S. Teoh via Digitalmars-d-learn wrote: > Switch statements in D allow all sorts of abominations, if only you > would try it. I think it was originally designed to support a particular > loop idiom (sorry I forgot what it was called, and don't have time to > l

Re: shouldn't this code at least trigger a warning?

2015-04-30 Thread ketmar via Digitalmars-d-learn
On Wed, 29 Apr 2015 10:48:36 +, Gary Willoughby wrote: > Please raise an issue in bugzilla. This is obviously an error. done: https://issues.dlang.org/show_bug.cgi?id=14532 signature.asc Description: PGP signature

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/29/15 5:25 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= " wrote: On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote: subj. the code: void main () { import std.stdio; char ch = '!'; switch (ch) { int n = 42; case '!': writeln(n, ": wow!"); break; default: }

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread Ali Çehreli via Digitalmars-d-learn
On 04/29/2015 07:57 AM, H. S. Teoh via Digitalmars-d-learn wrote: Switch statements in D allow all sorts of abominations, if only you would try it. I think it was originally designed to support a particular loop idiom (sorry I forgot what it was called http://en.wikipedia.org/wiki/Duff%27s_d

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Apr 29, 2015 at 06:37:44AM +, ketmar via Digitalmars-d-learn wrote: > subj. the code: > > void main () { > import std.stdio; > char ch = '!'; > switch (ch) { > int n = 42; > case '!': writeln(n, ": wow!"); break; > default: > } > } > > > i think

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote: subj. the code: void main () { import std.stdio; char ch = '!'; switch (ch) { int n = 42; case '!': writeln(n, ": wow!"); break; default: } } i think that such abomination should: 1. be forbidden,

Re: shouldn't this code at least trigger a warning?

2015-04-29 Thread via Digitalmars-d-learn
On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote: subj. the code: void main () { import std.stdio; char ch = '!'; switch (ch) { int n = 42; case '!': writeln(n, ": wow!"); break; default: } } i think that such abomination should: 1. be forbidden,

shouldn't this code at least trigger a warning?

2015-04-28 Thread ketmar via Digitalmars-d-learn
subj. the code: void main () { import std.stdio; char ch = '!'; switch (ch) { int n = 42; case '!': writeln(n, ": wow!"); break; default: } } i think that such abomination should: 1. be forbidden, or 2. trigger a warning, or 3. execute initializer anyway. c