I think the corollary to this rule is that if the super class constructor has non-defaulted arguments, the subclass must have an explicit constructor with an explicit call to super.new as its first executable statement. When the compiler inserts an implict call to super.new, it does so without any arguments. Dave > -----Original Message----- > From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On > Behalf Of Arturo Salz > Sent: Wednesday, January 17, 2007 6:35 PM > To: sv-ec@server.eda.org; prabhakar.s.ayyagari@intel.com > Subject: RE: [sv-ec] FW: A question about super.new > > Satya, > > That's not correct. If used, super.new must be the first executable > statement in the constructor, regardless on whether the constructor of > the superclass accepts any arguments or not. If the constructor of the > superclass takes no arguments or the class extension specifies the > arguments it accepts then the entire statement can be omitted as the > compiler will automatically insert a call to super.new at the start of > the constructor. > > Arturo > > -----Original Message----- > From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of > Mehdi Mohtashemi > Sent: Wednesday, January 17, 2007 6:21 PM > To: sv-ec@eda.org > Subject: [sv-ec] FW: A question about super.new > > FWD a question to the sv-ec alias. > > -----Original Message----- > From: Ayyagari, Prabhakar S [mailto:prabhakar.s.ayyagari@intel.com] > Sent: Wednesday, January 17, 2007 5:28 PM > To: owner-sv-ec@eda.org > Subject: A question about super.new > > Hi, > > Can I infer the following from sections 7.14 and 7.16: > super.new() need not be the first executable statement in the > constructor if the superclass does not have any arguments (or) is > super.new() always required to be the first executable statement with or > without arguments. > > Section 7.14: > When using the super within new, super.new shall be the first statement > **executed** in the constructor. > > Section 7.16: > A more general approach is to use the super keyword, to call the > superclass constructor: > > function new(); > super.new(5); > endfunction > > To use this approach, super.new(...) ** must be the first executable > statement ** in the function new. > > > Thanks, > Satya P Ayyagari > > -- > This message has been scanned for viruses and dangerous content by > MailScanner, and is believed to be clean. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Jan 18 11:47:46 2007
This archive was generated by hypermail 2.1.8 : Thu Jan 18 2007 - 11:47:53 PST