http://d.puremagic.com/issues/show_bug.cgi?id=8118


Dmitry Olshansky <dmitry.o...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.o...@gmail.com


--- Comment #2 from Dmitry Olshansky <dmitry.o...@gmail.com> 2012-05-19 
03:44:28 PDT ---
(In reply to comment #0)
> struct S
> {
>     @disable this();
>     this(int) { }
>     @disable void opAssign(typeof(this));
> }
> 
> class Test
> {
>     S s = void;      // I *EXPLICITLY* told it not to be initialized, but...
>     this() { s = S(to!int("1")); }
> }
> 
> void main() { new Test(); }
> 
> 
> Error: function S.opAssign is not callable because it is annotated with
> @disable
> Error: default construction is disabled for type Test
> 
> 
> 
> Structs without default constructors are pretty much impossible to use.
No bug here you just diabled too much. Undisable opAssign.

It's opAssign that gets called whne a = ... is seen:
this() { s = S(to!int("1")); }
If opAssign is trivial it replaced with bitblit. (that is disable comes first!)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to