Greetings All
I have a Struct (see minimized code below) which is failing for a simple
assignment. I am using DMD 2.053, and am getting an error:
> implicit.d(14): Error: cannot implicitly convert expression (foo1) of type
Foo!(4) to Foo!(NN)
Am I doing something wrong, or have I hit a DMD bug? Kindly note that this
happens only when I parameterize the struct using an Integral parameter, and
works file when using string as parameter (as with struct Bar in the code).
Regards
- Puneet
// File implicit.d
struct Foo (size_t N) {
void opAssign (size_t NN)(Foo!(NN) f) {/*do nothing*/}
}
struct Bar (string S) {
void opAssign (string SS)(Bar!(SS) f) {/*do nothing*/}
}
void main() {
Bar!"BAR1" bar1;
Bar!"BAR2" bar2;
bar2 = bar1; // this compiles fine
Foo!4 foo1;
Foo!4 foo2;
foo2 = foo1; // compilation error
}