struct S {
void opUnary(string op: "++")() {
bad;
}
}
struct S2 {
S s;
alias s this;
}
void main() {
S2 s;
++s;
}
Error: s is not a scalar, it is a S2
The error should be similar to that when the operator is called explicitly:
void main() {
S2 s;
s.opUnary!"++"();
}
onlineapp.d(4): Error: undefined identifier bad
onlineapp.d(15): Error: template instance onlineapp.S.opUnary!"++" error instantiating
Comment #1 by robert.schadek — 2024-12-13T19:15:22Z