Bug 10069 – Assignment to 'this' fails inside struct constructor during CTFE

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-12T09:40:00Z
Last change time
2013-11-21T08:06:44Z
Assigned to
nobody
Creator
tommitissari

Comments

Comment #0 by tommitissari — 2013-05-12T09:40:19Z
module main; struct Test { int v; this(int) { v = 123; } this(int, int) { this = test; // #1 } } enum test = Test(1); void main() { enum t = Test(11, 22); // #2 } // #1: Error: CTFE internal error: unsupported assignment this = Test(123) // #2: called from here: Test(0).this(11, 22)