stupid errors
Brad Roberts
braddr at puremagic.com
Tue Mar 21 22:18:53 PST 2006
On Wed, 22 Mar 2006, Regan Heath wrote:
> On Wed, 22 Mar 2006 04:20:29 +0000 (UTC), debugger
> <debugger_member at pathlink.com> wrote:
> > In article <1gjg8vs07wl1o$.tifrma18o0v$.dlg at 40tude.net>, Derek Parnell
> > says...
<snip pointless flamebait>
> If you've got nothing constructive to add stop posting, or, keep posting if it
> makes you happy just be prepared to be ignored as a "troll". Given the
> inflamatory nature of your post I am surprised you only got 1 agressive
> response.
>
> As Derek politely pointed out, you didn't post a complete example. Without a
> complete example there is no way for us to help you, in which case why post at
> all? (unless you're simply trolling?).
>
> I've done my best to produce a complete example, here is what I came up with:
>
> alias int SomeType;
>
> SomeType f(){
> SomeType result;
> result = 1;
> return result;
> }
>
> void g(){
> SomeType value;
> value = f(); switch(value){
> case 1:
> assert(value == 1); // fails !!!
> }
> }
>
> void main()
> {
> g();
> }
>
> I assume you meant for us to replace SOMECONST with an integer constant, if
> not, let me know what it was because nothing else I tried would compile. Using
> the code above I get no assert, which is the correct behaviour.
>
> Regan
I also tried this example with s/1/SOMECONST/ and adding this block at the
top:
//alias char[] SomeType;
//const char[] SOMECONST = "abcde";
alias int SomeType;
const int SOMECONST = 1;
Neither the char[] nor the int version assert for me.
I used my gdc 0.18 pre-release as well as dmd 0.148 and 0.149, all on
linux. I haven't grabbed 0.150 but Derek reported an inability to
reproduce the problem with 0.150 on xp earlier in the thread.
So, debugger, despite your arrogance and disdane for the rest of the D
community, there's interesting in fixing bugs in the D compiler both from
it's primary author and it's supporting team. If you'd be so kind as to
point out the difference between these test cases and your as-of-yet
undisclosed repro case, it'd be appreciated. If you'd also point out what
compiler and platform you used that'd help too.
Thanks,
Brad
More information about the Digitalmars-d-bugs
mailing list