hi EC, I recently had a query from a student who had tried to override a *data* member of a class... class C; int N = 3; function int get_N(); return N; endfunction endclass class D extends C; int N = 4; function int get_N(); return N; endfunction endclass ... ... D d = new; C c = new; $display(c.get_N()); // "3" as expected $display(d.get_N()); // "3" seen ???!!! (By the way, I don't even know which simulator this person was using.) It seems to me that this should be illegal, and you should be able to override only methods, not data members. Although the LRM hints as much, I can't find an explicit prohibition of overriding a data member, nor a description of what to do should it occur. Any other opinions? Is this just a compiler failing to report an error, or have I missed something? Do we need some minor LRM clarification for this? -- Jonathan Bromley, Consultant DOULOS - Developing Design Know-how VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK Tel: +44 (0)1425 471223 Email: jonathan.bromley@doulos.com Fax: +44 (0)1425 471573 Web: http://www.doulos.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Fri Oct 19 07:19:30 2007
This archive was generated by hypermail 2.1.8 : Fri Oct 19 2007 - 07:19:38 PDT