RE: [sv-ec] reference via scope operator to parametrized superclass item

From: Rich, Dave <Dave_Rich_at_.....>
Date: Wed Jun 10 2009 - 10:59:26 PDT
But the scope of an extended class includes its base class. That's the
definition of inheritance; its an extended scope.

 

________________________________

From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
Behalf Of Bresticker, Shalom
Sent: Wednesday, June 10, 2009 10:47 AM
To: Mark Hartoog; Daniel Mlynek; sv-ec@eda.org
Subject: RE: [sv-ec] reference via scope operator to parametrized
superclass item

 

But 8.24.1 says,

"Use of the class resolution operator with a prefix that is the
unadorned name of a parameterized class (see 8.24) shall be restricted
to use within the scope of the named parameterized class and within its
out-of-block declarations (see 8.23)."

According to that, you could not write B::a, you would have to write
B#(p)::a.

Shalom

	 

	
________________________________


	From: owner-sv-ec@server.eda.org
[mailto:owner-sv-ec@server.eda.org] On Behalf Of Mark Hartoog
	Sent: Wednesday, June 10, 2009 8:28 PM
	To: Daniel Mlynek; sv-ec@eda.org
	Subject: RE: [sv-ec] reference via scope operator to
parametrized superclass item

	This is mentioned in section 8.22:

	 

	"The class scope resolution operator enables the following:

	- Access to static public members (methods and class properties)
from outside the class hierarchy.

	- Access to public or protected class members of a superclass
from within the derived classes.

	- Access to type declarations and enumeration named constants
declared inside the class from outside

	the class hierarchy or from within derived classes."

	 

	But it is not discussed in 8.24.1 for parameterized classes. 

	 

	From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf
Of Daniel Mlynek
	Sent: Wednesday, June 10, 2009 4:45 AM
	To: sv-ec@eda.org
	Subject: [sv-ec] reference via scope operator to parametrized
superclass item

	 

	LRM has special chapter :8.24.1 Class resolution operator for
parameterized classes

	 

	Unfortunatelly this chapter misses one important feature of
scope operator - it can be used to reference to super classs item.
Chapter 8.24.1 does not explicitly states that :: can be used on
unadorned base class name to reference base class item.

	IMHO codes like below are shoould be legal and LRM should
description should be extended:

	 

	CODE:

	 

	class B#(p=1);
	 int a;
	endclass

	 

	class C#(p=1) extends B#(p);
	 bit a;
	 function void foo;
	  $display(B::a); //<<<<<<<<this reference via :: is not
described in LRM
	 endfunction
	endclass      

	 

	module top;
	 C c;
	 initial begin
	  c = new;
	  c.foo();
	 end
	endmodule

	 

	 

	Should I fill a mantis on that?

	 

	 

	DANiel

	
	-- 
	This message has been scanned for viruses and 
	dangerous content by MailScanner <http://www.mailscanner.info/>
, and is 
	believed to be clean. 

	
	-- 
	This message has been scanned for viruses and 
	dangerous content by MailScanner <http://www.mailscanner.info/>
, and is 
	believed to be clean. 

---------------------------------------------------------------------
Intel Israel (74) Limited
 
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , 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 Jun 10 11:01:49 2009

This archive was generated by hypermail 2.1.8 : Wed Jun 10 2009 - 11:02:43 PDT