Bug 7599 – Method parameter undefined in out-block

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2012-02-27T00:20:00Z
Last change time
2014-07-24T17:22:53Z
Keywords
wrong-code
Assigned to
nobody
Creator
magnus

Comments

Comment #0 by magnus — 2012-02-27T00:20:49Z
I the following code, the parameter arg is undefined in the out-block (as can be seen by the huge, arbitrary values it assumes). However, by uncommenting the assert (i.e., forcing the in-block to be included) avoids the bug, so arg == 0. module main; import std.conv; class Class { void method(uint arg) in { // assert(arg + 1); // Uncomment to prevent bug } out { assert(arg == 0, "BUG: arg == " ~ to!string(arg)); } body {} } void main(string[] args) { (new Class).method(0); }
Comment #1 by magnus — 2012-02-27T00:26:03Z
Sorry -- some additional details missing from original post: Running DMD64 D Compiler v2.058 on Mac OS X, Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64.
Comment #2 by lovelydear — 2012-04-20T02:22:56Z
Couldn't reproduce the bug on 2.059 WinXP.
Comment #3 by yebblies — 2014-07-24T14:48:42Z
I can't reproduce it either on win32 or linux64. Can anybody reproduce on osx64? If not this should be closed.
Comment #4 by magnus — 2014-07-24T17:21:37Z
I tried on OS X 64 (where I initially had problems), and it works fine now.
Comment #5 by yebblies — 2014-07-24T17:22:53Z
Awesome!