www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15957] New: Disabled postblit + template mixin break opAssign

https://issues.dlang.org/show_bug.cgi?id=15957

          Issue ID: 15957
           Summary: Disabled postblit + template mixin break opAssign with
                    confusing error message
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: public dicebot.lv

```
struct S
{
     disable this(this);

    mixin Impl;
}

template Impl ( ) 
{
    void opAssign ( int[] x ) { } 
}

unittest
{
    S s;
    s = [ 1, 2, 3 ];
}


// function wat.S.opAssign (S p) is not callable using argument types (int[])
```

Either moving opAssign from template to struct directly or removing ` disable
this(this)` makes the snippet compile.

--
Apr 25 2016