[sv-ec] Package references/LRM

From: Francoise Martinolle <fm_at_.....>
Date: Wed Jul 15 2009 - 15:11:41 PDT
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, and is
believed to be clean.
Received on Wed Jul 15 15:12:03 2009

This archive was generated by hypermail 2.1.8 : Wed Jul 15 2009 - 15:12:51 PDT