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

           Summary: Compiler gives error when post-contract is used in a
                    function that returns from inside a loop
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: thi...@gmail.com


--- Comment #0 from thi...@gmail.com 2012-04-14 08:21:46 PDT ---
When using this code with DMD32 v2.059:

int func()
out(result) { assert(result == 3); }
body
{
  while(true) {
    return 3;
  }
}

void main() {
  func();
}

The compiler produces the following error:
bug.d(1): Error: function bug.func no return exp; or assert(0); at end of
function

The error also happens when a 'for' is used instead of 'while'.

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

Reply via email to