Bug 6323 – Regression(2.054) calling opAssign inside a struct initializer

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2011-07-15T07:46:00Z
Last change time
2011-09-06T00:56:59Z
Assigned to
nobody
Creator
soywiz

Comments

Comment #0 by soywiz — 2011-07-15T07:46:36Z
version = PROBLEM_ON_2054; struct TT { int v; static TT opCall(int vv) { TT v = void; v.v = vv; return v; } this(int that) { version (PROBLEM_ON_2054) { opAssign(that); } else { v = that; } } void opAssign(int that) { v = that; } } struct Test { TT field = TT(1); static assert (Test.init.field.v == 1); } int main(string[] args) { return 0; }
Comment #1 by kennytm — 2011-07-15T09:09:24Z
The 'regression' is introduced in commit 846aa2683ec63c364e72281c4c655387806558e2. https://github.com/D-Programming-Language/dmd/commit/846aa
Comment #2 by clugdbug — 2011-09-06T00:56:42Z
This had the same root cause as bug 6337.
Comment #3 by clugdbug — 2011-09-06T00:56:59Z
*** This issue has been marked as a duplicate of issue 6337 ***