Francoise, the entire point of the restriction on compilation unit references is to not allow packages to have external dependencies. So I would consider this example to be illegal. Gord Francoise Martinolle wrote: > Is this legal? > > > package p1; > class c1; > endclass > endpackage > > import p1::*; > > package p2; > class c2 extends c1; > endclass > endpackage > > > according to the LRM section 26.2 > > Items within packages shall not have hierarchical references to > identifiers except > > those created within the package or made visible by import of another > package. A package shall not refer to > > items defined in the compilation unit scope. > > With the language above ("items defined") it is not completely clear if > c1 can be referred by package p2. c1 is not declared > > in the compilation unit but is made visible in the cu by the import > clause. What is the meaning of defined? > > > > It is clear that if you move the import inside package p2, all is well. > > Francoise > > > > > -- > This message has been scanned for viruses and > dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is > believed to be clean. -- -------------------------------------------------------------------- Gordon Vreugdenhil 503-685-0808 Model Technology (Mentor Graphics) gordonv@model.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Fri Jul 17 12:43:59 2009
This archive was generated by hypermail 2.1.8 : Fri Jul 17 2009 - 12:44:53 PDT