User guide

24-157
SystemVerilog Testbench Constructs
When executed, the output of the program code is:
Point 1: Value = 5
Point 2: Value = 5
Point 3: Value = 6
Output is: 6
hide_list details
The hide_list item of an extends_directive specifies the
permission(s) for introductions to hide symbols, and/or advice to
modify local and protected methods. By default, an introduction does
not have permission to hide symbols that were previously visible in
the target scope, and it is an error for an extension to introduce a
symbol that hides a global or super-class symbol.
The hide_list option contains a comma-separated list of options such
as:
The virtuals option permits the hiding (that is, overriding) of
virtual methods defined in a super class. Virtual methods are the
only symbols that may be hidden; global, and file-local tasks and
functions may not be hidden. Furthermore, all introduced
methods must have the same virtual modifier as their overridden
super-class and overriding sub-class methods.
The rules option permits the extension to suspend access rules
and to specify advice that changes protected and local virtual
methods; by default, extensions cannot change protected and
local virtual methods.
An empty option list removes all permissions, that is, it resets
permissions to default.
In Example 24-19, the print method introduced by the extends
directive hides the print method in the super class.