SystemVerilog OOP Mastery · All levels
Shallow vs Deep Copy: Pitfalls
Pitfalls for Shallow vs Deep Copy.
Pitfalls and red flags
Assuming class assignment behaves like packed struct value copy.
Using new rhs and believing all nested objects are automatically unique.
Pushing aliased objects into scoreboard queues and corrupting historical expected data.
Forgetting null checks before recursively copying nested handles.