Question on set_type_override_by_type API

Hello,
I have a question on set_type_override_by_type API of factory -
UVM reference manual gives following description of the set_type_override_by_type API:


function void set_type_override_by_type (uvm_object_wrapper original_type,uvm_object_wrapper override_type,bit replace = 1);

When overriding by type, the original_type and override_type are handles to the types’
proxy objects. Preregistration is not required.
When overriding by name, the original_type_name typically refers to a preregistered type
in the factory. It may, however, be any arbitrary string. Future calls to any of the
create_* methods with the same string and matching instance path will produce the type
represented by override_type_name, which must be preregistered with the factory.
When replace is 1, a previous override on original_type_name is replaced, otherwise a
previous override, if any, remains intact.

Now if we set two overrides with replace bit zero, which one will take effect :


set_type_override_by_type(trans::get_type(), trans2::get_type());
set_type_override_by_type(trans::get_type(), trans3::get_type(), 1'b0);


In this case, will create return object of type trans3 or trans2. How is it decided?

thanks,
-sunil

In reply to puranik.sunil@tcs.com:

trans2. The second override is ignored because there is already an override in place.
For the first override, the replace argument has the default value of 1, but the replace argument’s value does not matter for the first override.