Bug 11186 – Regression (2.061): Presence of Variant and const field invokes opAssign

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-06T13:24:00Z
Last change time
2013-10-14T20:53:54Z
Assigned to
nobody
Creator
andrej.mitrovich
Depends on
9665

Comments

Comment #0 by andrej.mitrovich — 2013-10-06T13:24:21Z
----- import std.variant; struct S { Variant v; const(bool) b; } class C { this() { s = S.init; // why is this calling opAssign? } S s; } void main() { } ----- 2.060: $ dmd test.d > 2.061: $ dmd test.d > Error: can only initialize const member b inside constructor 2.062, 2.063, 2.064 (git-head): $ dmd test.d > test.d(15): Error: function test.S.opAssign is not callable because it is annotated with @disable If *either* (or both of course) the variant or boolean fields are removed, it compiles fine. But for some reason when both are present, there's a compile error.
Comment #1 by bugzilla — 2013-10-14T20:53:54Z