Need for the $cast task in System Verilog

In reply to Shri Ganesh:

https://verificationacademy.com/courses/systemverilog-oop-for-uvm-verification

if you wanna know more, google “compiler” it might help you