[Issue 15957] New: Disabled postblit + template mixin break opAssign with confusing error message

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Apr 25 17:21:16 PDT 2016


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 at puremagic.com
          Reporter: public at 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.

--


More information about the Digitalmars-d-bugs mailing list