D - using cast() implicitly
- Yan (24/24) Feb 16 2004 imho this is unobvious error:
imho this is unobvious error:
int main(char[][] args) {
T a = new T();
T b = new T();
T c = a+b; // good
c = (a+b); // good
c = (a)+(b); // ERROR: a is used as a type
c = (a+b)+b; // good
return 0;
}
class T {
private int Value;
this() {
Value =1;
}
T opAdd(T inp) {
T ret = new T();
ret.Value=inp.getValue()+Value;
return ret;
}
int getValue() {
return Value;
}
}
Feb 16 2004








Yan <Yan_member pathlink.com>