[Mono-list] limited checked exceptions proposal discussion

Piers Haken piersh@friskit.com
Tue, 8 Apr 2003 11:37:05 -0700


I think you have "protected internal" mixed up. It doesn't mean what it
sounds like. It's "protected || internal" as opposed to "protected &&
internal".

Piers.

> -----Original Message-----
> From: David Jeske [mailto:jeske@chat.net]=20
> Sent: Tuesday, April 08, 2003 11:10 AM
> To: Mono List
> Subject: Re: [Mono-list] limited checked exceptions proposal=20
> discussion
>=20
>=20
> On Mon, Apr 07, 2003 at 02:36:06PM +1000, Fergus Henderson wrote:
> > On 30-Mar-2003, David Jeske <jeske@chat.net> wrote:
> > > Inferring thrown exceptions is not hard like
> > > ML-style type inference -- It's trivial.
> >=20
> > How do you plan to handle virtual methods?
>=20
> All virtual methods which can be overridden or called outside=20
> the assembly will require throws declarations. From the chart=20
> below, this includes "protected" and "public":
>=20
>                         virtual      cross-assembly override/call
> -----------------------------------------------------------------
>            private    not-allowed        not-allowed
>           internal      allowed          not-allowed
> protected internal      allowed          not-allowed
>          protected      allowed            allowed
>             public      allowed            allowed
>=20
> Requiring throws declarations on "protected" and "public"=20
> virtual methods is consistant with the treatment of=20
> delegates. Namely, because virtual methods and delegates are=20
> both explaning a type-contract that someone else may implement:
>=20
>  (a) the declaration must declare what exceptions can be thrown, and
>  (b) the implementor must meet the contract.=20
>=20
> "internal" and "protected internal" virtual methods are=20
> allowed, but are only accessable from within the assembly.=20
> Because all implementations must occur within a single=20
> assembly, we can infer that any exception which appears in an=20
> override of the virtual method may appear at the virtual=20
> method call site. This allows us to not require the "throws"=20
> declaration for these methods.
>=20
> "private" virtual methods are not allowed.
>=20
> --=20
> David Jeske (N9LCA) + http://www.chat.net/~jeske/ +=20
> jeske@chat.net _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com=20
> http://lists.ximian.com/mailman/listinfo/mono-> list
>=20