I did define covariant types in the proposal. I proposed to add a new section in chapter 6
titled covariant types 6.22.4.
In my definition I only expressed covariance for class types, I think we need to discuss in the committee
whether or not we want to open it up for other other types. Like you said we could define covariance be legal
between integral types as long as there is no loss of data.
For example we could define that byte is covariant with int type, that is the int type can be subsituted with the byte type
in a virtual method override return type or output argument.
6.22.4 Covariant types
Covariance is the ability to assign an expression of a more specialized type to an expression of a more general, less specialized type.
A derived class type and its parent class types are said to be covariant because a variable of a derived class type can be assigned to a variable of a parent class type.
________________________________
From: Daniel Mlynek [mailto:danielm@aldec.com.pl]
Sent: Monday, February 21, 2011 1:59 AM
To: Francoise Martinolle
Cc: sv-ec@server.eda.org
Subject: Re: [sv-ec] mantis item 3278 proposal uploaded
this proposal is using covariant type term .
This term is not defined in LRM. What does it mean.
DANiel
On 2/19/2011 1:40 AM, Francoise Martinolle wrote:
-- 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 Mon Feb 21 10:53:33 2011
This archive was generated by hypermail 2.1.8 : Mon Feb 21 2011 - 10:54:03 PST