[phobos] Throwing Object

Walter Bright walter at digitalmars.com
Tue Jan 5 20:09:52 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3678

Andrei Alexandrescu wrote:
> Could we simply disallow statically throwing Object? That would be the 
> ideal solution. Looks like we're all in agreement. Walter, do you want 
> me to bugzillize this request?
>
> Andrei
>
> Sean Kelly wrote:
>> In a prior discussion with Andrei we agreed that in instances where 
>> there are multiple in-flight exceptions, the exceptions would all be 
>> chained via the .next property and passed up the stack together.  I 
>> just started implementing some of the code for this and have run into 
>> a snag: it's possible to throw instances of Object, and Object 
>> doesn't have a .next field.  I've toyed with some rather complex 
>> rules for resolving this, but the real problem is that Object 
>> instances can be thrown at all.  May I assume that the user should 
>> only ever throw Exceptions (ie. children of Error or Exception) and 
>> have some straightforward way for handling the Object case, be it 
>> ignore the Object, wrap it in an ObjectWrapperException, or something 
>> like that?
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>


More information about the phobos mailing list