In reply to UVM_LOVE:
You are mixing 2 different constructs.
(1) $cast is a SystemVerilog task/function. This is a language feature.
(2) override is a UVM methodology construct using SystemVerilog.
It would be great to know what your intention is to use $cast an override.