Constraint for error injection

In reply to syed taahir ahmed:
Works in my simulator. const casting is a relatively new feature of SystemVerilog and the simulator on EDAPlayground are older. See Constraint | Verification Academy