Thread overview | |||||
---|---|---|---|---|---|
|
November 12, 2003 catch the assert | ||||
---|---|---|---|---|
| ||||
According to the reference document, assert() throws an exception and we can catch it. So I tried to write code with this technique, but then i run into a problem.
Thrown object's class seems to be std.assert.Assert, but since "assert" is a reserved identifier, I cannot do:
import std.assert;
Is there any way to deal with this? Or, std.assert is only for internal use and
we should catch the exceptions from assert() with catch(Object o) {} ?
--
K.INABA( ki@kmonos.net )
|
November 14, 2003 Re: catch the assert | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kazuhiro Inaba | "Kazuhiro Inaba" <Kazuhiro_member@pathlink.com> wrote in message news:botnq7$2uqv$1@digitaldaemon.com... > According to the reference document, assert() throws an exception and we can > catch it. So I tried to write code with this technique, but then i run into a > problem. > > Thrown object's class seems to be std.assert.Assert, but since "assert" is a > reserved identifier, I cannot do: > > import std.assert; Yes, that's a bug I need to fix. > Is there any way to deal with this? Or, std.assert is only for internal use and > we should catch the exceptions from assert() with catch(Object o) {} ? That will work for the moment. |
Copyright © 1999-2021 by the D Language Foundation