So I didn't hear how we bottomed out on the casting issue. Illegal or not to cast from a null handles? Need to know to finish up the proposal for 1356. Thx, -Tom
8.25.3 Casting and Object reference assignment
There are a handful of relationships that must be clearly defined in order for interface classes to work properly with SystemVerilog. In order to maintain the OOP and polymorphic semantics, it shall be legal to assign an interface class handle to a child object that implements it.
PutImp #() put_ref;
Fifo#() fifo_obj = new;
put_ref = fifo_obj;
It shall also be possible to have multiple references of an interface class and use them to cast from one to other.
PutImp #() put_ref;
GetImp #() get_ref;
Fifo#() fifo_obj = new;
put_ref = fifo_obj;
$cast(get_ref, put_ref);
Committee needs to clarify what null means when we use it in this casting, class handles that happen to be null. Can the source handle be of null value? This needs to be legal (and copy the null across) or illegal (an error in a task form, function form is a success/fail). This should follow the same rules as when you have two handles and the assignment happens between the two. Implementations are managing this differently and the LRM does not clarify this. If the user really wants to cast a null, they can check for null reference and if it is null then assign null to the dest reference, else do the cast. Is there a mantis item for null assignments across $cast. This casting of normal class hands is not addressed in the LRM.
Mantis 3293 defines what $cast does in general, but will resolve this.[t1]
________________________________
[t1]Issue #4 from 1/18/2011 mantis note.
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon May 9 12:49:31 2011
This archive was generated by hypermail 2.1.8 : Mon May 09 2011 - 12:49:35 PDT