This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FYI: added explicit constructor to avoid interpretation of its visibility


> Hi,
>   as explained on the classpath ml, there is an interpretation of the
> JLS which makes different compilers produce different visibility for the
> constructor of a private inner classe without explicit constructor
> (namely private with jikes, and non private with ecj). To avoid this
> ambiguity, I added this constructor explicitely.
> 
> 
>   I wonder whether this kind of test should be added in jacks.

Jacks already tests this.  ecj is buggy - the JLS requires default
constructors to have the same visibility as their enclosing class,
so private inner classes default to private constructors.  Furthermore,
calling a private constructor from the outer class requires
a default-visibility bridge constructor, so it is always a good idea
to explicitly declare constructors of private inner classes in order to
avoid having to use the bridge constructor.

--
Eric Blake


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