Forgetting to build the opOPAssign template correctly results in a confusing error away from where it actually is.
Example in module A:
500 struct item
501 {
502
503 opOpAssign( int x ) { ... }
504
505 }
Meanwhile, somewhere in another module B:
1000 item i;
1001 i ~= 5;
Error (1001): i.opOpAssign isn't a template.
OK, so opOpAssign is not a template, but that explains almost nothing and supplies few clues as to where the error really is and how to make a correction.
The error message can be improved considerably by stating the type involved, eg "item" and the offending module and line of code eg, module A, line 503, along with a meaningful hint stating what the opOpAssign signature should look like, eg opOPAssign(string op)(T value) or if it can be deduced from line 1000 opOPAssign("~")( int x ) which would be even better.
Comment #1 by robert.schadek — 2024-12-13T18:09:58Z