digitalmars.D.bugs - [Issue 7910] New: Compiler gives error when post-contract is used in a function that returns from inside a loop
- d-bugmail puremagic.com (33/33) Apr 14 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7910
- d-bugmail puremagic.com (11/11) May 02 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7910
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: nobody puremagic.com ReportedBy: thiezz gmail.com --- Comment #0 from thiezz 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: -------
Apr 14 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7910 Alex Rønne Petersen <xtzgzorex gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |contracts CC| |xtzgzorex gmail.com --- Comment #1 from Alex Rønne Petersen <xtzgzorex gmail.com> 2012-05-02 19:56:34 PDT --- I can confirm; with no contract, DMD emits no error. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 02 2012