Re: [sv-ec] Re: [sv-bc] Name resolution and imports

From: Greg Jaxon <Greg.Jaxon_at_.....>
Date: Mon Sep 11 2006 - 14:01:40 PDT
What do you see as support for that claim? The identifier "base"
is not bound inside the scope of class base, or its descendants;
it is bound in the package scope that is exporting it.

I agree that the base class can be used freely by anyone who
imports a class derived from it, but they surely did only know its
name if the producer of the derived class passes it along.
Of course most folks would want that effect, which is why
package chaining seemed so natural.

Greg


Francoise Martinolle wrote:
> I agree with Dave, the base class is visible through the class
> inheritance of p3. 
> 
> Francoise
>     ' 

> I might disagree that is not legal. Class p3 will get access to the
> symbols via the class hierarchy mechanism. It does not need to go
> through the package.
> 
> Dave
> 
> 
>> -----Original Message-----
>> From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org]
> On
>> Behalf Of Arturo Salz
>> Sent: Monday, September 11, 2006 11:00 AM
>> To: Vreugdenhil, Gordon; Arturo Salz
>> Cc: Logie Ramachandran; Mark Hartoog; SV_BC List; SV_EC List; sv- 
>> ac@server.verilog.org
>> Subject: RE: [sv-ec] Re: [sv-bc] Name resolution and imports
>>
>> You are correct in that simple case, but, consider the following
> example
>>    package p1;
>>       class base;
>>          int x;
>>          virtual function void F(base x); ...  endfunction
>>       endclass
>>    endpackage
>>
>>    package p2;
>>       class derived extends p1::base;
>>          int y;
>>       endclass
>>    endpackage
>>
>>    module top;
>>       import p2::*;
>>
>>       class p3 extends derived;
>>          virtual function void F(base x);	// this is not legal
>> without the re-import
>> 	 ...
>>         endfunction
>>
>>         ...
>>    endmdodule
>>
>> In this case, the base class is not visible to the importing scope 
>> without explicitly importing package p1. Or is it? Why should
> end-users
>> need to add an explicit import of p1 (import p1::*) or explicitly
> write
>> (p1::base)?
>>
>> 	Arturo
Received on Mon Sep 11 14:01:53 2006

This archive was generated by hypermail 2.1.8 : Mon Sep 11 2006 - 14:02:13 PDT