Hardware interview practice
Use checked down-casting in SystemVerilog
A base-class handle refers to an object whose dynamic type may be derived. Which statement about casting is correct?
Choose one
Answer choices
- A. Every down-cast succeeds at compile time.
- B. Virtual methods dispatch only from the handle's declared type.
- C. Inheritance prevents polymorphism.
- D. Assigning derived to base is an up-cast; recovering derived should use checked `$cast` and can fail for an incompatible dynamic type.
