Issue with usage of const input in methods

In reply to dave_59:

Hi Dave ,

SV LRM 13.5.2 says :: " When the formal argument is declared as const ref , the subroutine cannot alter the variable , and an attempt to do so shall generate a compile error " .

I am confused by what it means by “cannot alter the variable” when we talk about objects .
I understand that we don’t discuss simulator issues here but I see different results on simulators .

Those which flash error do no allow to change the contents of the object ( All flash an error on usage of const ref and using new() on the object passed as argument )


function void DISP ( cons ref trans t ) ;
    // t = new() ; // Error 
     t.a = 100 ;  // Modifying contents of object has conflicting Outputs on Simulators 
.....
endfunction