[Issue 10842] New: auto return function not executed depending on how it's called

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 17 18:28:52 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10842

           Summary: auto return function not executed depending on how
                    it's called
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thelastmammoth at gmail.com


--- Comment #0 from thelastmammoth at gmail.com 2013-08-17 18:28:51 PDT ---
dmd -version=A -run main.d: prints nothing
dmd -version=B -run main.d: prints ok

----
auto fail(){
  import std.stdio;
  writeln("ok");
  /+
  //would be same with this: 
  assert(0);
  //or this:
  import std.exception; throw new Exception("bad");
  +/
  return null;
}

string foo(){
    version(A){
      auto temp=fail();
      return temp;
    }
    else
      return fail();
}

void main(){
  foo();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list