Exception transparency vs constructors

Mark Mahieu mark at twistedbanana.demon.co.uk
Thu May 15 18:22:00 PDT 2008

It looks like exception transparency isn't working quite right with  
constructors - I think the following class should compile, but it  

public class ExTrans {

     <throws X> ExTrans({=> void throws X} block) throws X {

     public static void main(String[] args) throws Exception {
         new ExTrans({=> throw new Exception(); });

ExTrans.java:8: unreported exception X; must be caught or declared to  
be thrown
         new ExTrans({=> throw new Exception(); });
1 error



More information about the closures-dev mailing list