[sv-ec] Follow-up from last call -- legality of virtual/pure virtual overrides

From: Gordon Vreugdenhil <gordonv@Model.com>
Date: Fri Jun 24 2011 - 09:10:37 PDT

This is just to follow-up the questions that I raised in the last EC call.

Is the following legal:

    module top;
      virtual class c;
         virtual function void f(int a); endfunction
      endclass
      class d extends c;
         pure virtual function void f(int a);
      endclass
    endmodule

There are a couple of questions about the legality:
   1) can "c" provide an implementation for a later
       "pure virtual" prototype?
   2) if (1) is permitted, can "d" be non-virtual?
   3) if (1) is not permitted, can the "f" in some
       further extension of "d" call "super.f"?

If the "f" in "d" is supposed to "hide" the virtual
definition in "c" (which I find very troublesome),
is the prototype permitted to change? i.e. can you
then have:
         pure virtual function void f(reg a);
as the prototype in "d" -- "hiding" generally means
the incompatibility is Ok.

None of these situations are clearly addressed by
the current rules and definitely impact how we talk
about various interface class / class interactions.

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 Jun 24 09:11:09 2011

This archive was generated by hypermail 2.1.8 : Fri Jun 24 2011 - 09:11:20 PDT