Summary: Skipping declaration with goto resulted in nonsense
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD

--- Comment #0 from Adam D. Ruppe <> 2011-09-16 
16:53:35 PDT ---
I'm in the middle of a project right now so will be brief and can add more

Given code like such:

auto somethingResult = getSomething();

       goto dont_have_something;

auto something = somethingResult.front;


  if(something !is null) {
        // potential problem here if the result was empty - "something" doesn't
refer to what I thought it would!


The goto over the variable declaration probably should have been a compile
error, I believe, from the spec. This was kinda a pain to find when it started
crashing since the variable actually referred to an entirely different object!

I'm using last month's dmd too, so possible it's already been fixed. I just
want to post something here before I forget about it.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to