Bug 2937 – postblit not called for foreach arg over array of structs

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-05-04T23:24:00Z
Last change time
2015-06-09T01:26:25Z
Keywords
wrong-code
Assigned to
nobody
Creator
cristian

Attachments

IDFilenameSummaryContent-TypeSize
349feapblit.dtest casetext/plain182

Comments

Comment #0 by cristian — 2009-05-04T23:24:27Z
The assertion fails in the following program (I was able to fix it in my back-end for .NET but it is probably best for a fix to go into the front-end). struct X { int i; this(this) { ++i; } } void main() { X [1] xs; xs[0] = X(); foreach(x; xs) { assert(x.i == 1); } }
Comment #1 by cristian — 2009-05-04T23:25:44Z
Created attachment 349 test case
Comment #2 by gide — 2009-05-06T03:35:32Z
Similar to BUG 2674.
Comment #3 by bugzilla — 2009-09-03T13:36:16Z
Fixed dmd 2.032