This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcj/173


The following reply was made to PR gcj/173; it has been noted by GNATS.

From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com
Cc:  
Subject: Re: gcj/173
Date: Wed, 15 Mar 2000 23:49:56 +1300

 The patch works for me. I'm not sure I like the javac-style error
 message though: "No enclosing instance for inner class `Scope2$A' is in
 scope; an explicit one must be provided when creating this inner class."
 
 Is there really actually a way in Java to "provide an explicit instance"
 of the enclosing class, thus constructing an inner class from static
 code? If there is I've never seen it used or figured it out, and this
 error from javac has allways puzzled me because it seems to indicate
 that you CAN do just that.
 
 Jikes says "An instance of "Scope2.this" is not accessible here because
 it would have to cross a static region in the intervening type
 "Scope2"."
 
 I like that slightly better, but maybe "Cannot create instance of
 non-static inner class from static context" is all it really needs.
 
 regards
 
   [ bryce ]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]