Version française
Home     About     Download     Resources     Contact us    
Browse thread
throws
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Monniaux <David.Monniaux@e...>
Subject: throws
[resume: suggestion d'implementer une analyse statique et sommaire de
detection de fuites potentielles d'exceptions semblable a celle de Java]

The Java language has a nice feature: static detection of exception
leaks (or, more exactly, a conservative and simple approximation of it,
since the full problem is of course undecidable).
That is, functions must declare the exceptions they can throw
(except those generated by the runtime system); exceptions that can be
thrown from function f are inferred by looking at those that can be thrown
by the functions called from f, those that are explicitely thrown in f and
those that are caught in f.

Pardon me if I'm mistaken, but this sounds easy and cheap to implement.
Could it be possible to add a construct like this:

throws
<list of throwable exceptions>
in <expression> ?

Only terms tagged such as above would be checked so as to allow upwards
compatibility.

Does this sound nifty? And implementable?

---
David Monniaux     Tel: +33 1 44 32 20 66    Fax: +33 1 44 32 20 80 
Laboratoire d'informatique de l'École Normale Supérieure,
45 rue d'Ulm - 75230 PARIS cedex 5 - FRANCE