Disabling opAssign in a type disabled all the opAssigns of an aliased type?

aliak something at something.com
Mon Jul 30 18:30:16 UTC 2018


Is this a bug?

If not is there a workaround?

I would like for the alias this to function as a normal A type 
unless B specifically disables certain features, but it seems 
weird that disabling one opAssign disables all of them inside the 
aliases type but not in the aliasing type?


struct A {
     void opAssign(int) {}
}
struct B {
     A a;
     alias a this;
     @disable void opAssign(float);
}

void main() {
     B b;
     b = 3;
}

Error: function `onlineapp.B.opAssign` is not callable because it 
is annotated with @disable

Cheers,
- Ali


More information about the Digitalmars-d-learn mailing list