January 29, 2004 [Bug] AssertError.toString() == "Object" | ||||
---|---|---|---|---|
| ||||
For some reason, AssertError is missing a toString() definition, instead defining its own print() method. This means that the following program just prints "Object", rather than giving a description of the error.
Consistency is lost, and it becomes impossible to display the error by some other means, and hence to easily pinpoint assert errors in Windows GUI apps.
Moreover, why is AssertError descended straight from Object, and not from Exception or Error?
Stewart.
----------
import std.c.stdio;
int main() {
try {
assert (false);
} catch (Object e) {
puts(e.toString());
}
return 0;
}
--
My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
|
Copyright © 1999-2021 by the D Language Foundation