There is no statement in LRM which defines if virtual keyword is optional for virtual function. Consider below example class B; function void f; $display("b");endfunction //this function is overriden by virtual fucntion in child class. is it allowed? is this function virtual??? endclass class C extends B; virtual function void f;$display("c"); endfunction //this function is overrides nonvirtual from base class - is it allowed? endclass class D extends C; function void f;$display("d"); endfunction //this function declaration skips virtual keyword : is it legal? is this function still virtual? endclass B b=new; C c=new; D d=new; initial begin b.f; b=c; b.f; c.f; b=d;c=d; b.f; c.f; d.f; end endmodule Assuming that above should compile we may get 2 different results: Result 1: b b c b d d Result 2: b c c d d d IMHO LRM should have explicit rules for above. and result 1 should be correct. DANiel -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Apr 9 05:31:53 2008
This archive was generated by hypermail 2.1.8 : Wed Apr 09 2008 - 05:32:23 PDT