RE: [sv-ec] FW: A question about super.new

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Wed Jan 17 2007 - 18:35:08 PST
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.
Received on Wed Jan 17 18:35:33 2007

This archive was generated by hypermail 2.1.8 : Wed Jan 17 2007 - 18:35:46 PST