Re: [sv-bc] Issue 131 / Mantis 2611 -- package/class lookup

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Fri Apr 24 2009 - 13:22:55 PDT
Greg Jaxon wrote:
> Gordon Vreugdenhil wrote regarding Mantis 2611:
>> If you claim that you must pay attention to the *type* of
>> C then you have issues with:
>>     package C;
>>       int y;
>>     endpackage
>>     module top #(type T);
>>       T C;
>>       int x = C::y;
>>     endmodule
>>
>> Given that this is purely lexical search, I think it makes the
>> most sense to say that '::' prefix resolution is eager and
>> does package resolution only if no other intervening name
>> exists.
> This part of your answer is a straw man argument.
> There /are no/ bindings of T which would ever make C::y a legal 
> reference into the local object C.


Oops; I messed up here.

I meant to have:
      module top #(type C);
        int x = C::y;
      endmodule

So if C is a type parameter, you can definitely do C::y if
C is bound to a class type but can't if it binds to an int.

Gord

-- 
--------------------------------------------------------------------
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 Apr 24 13:27:37 2009

This archive was generated by hypermail 2.1.8 : Fri Apr 24 2009 - 13:30:40 PDT