----------------------
How narrowing is done?
----------------------

When calling CORBA.ORB.resolve_initial_references("NameService")
the CorbaScript engine knows by default that the interface will be
at least an IDL:omg.org/CosNaming/NamingContext:1.0

Let's consider that RO is the real object.
Let's consider that RI is the real object's interface.

If RI is equal to IDL:omg.org/CosNaming/NamingContext:1.0 then
{
  the type of the RO is CosNaming::NamingContext
}
else  #  RI is not equal to IDL:omg.org/CosNaming/NamingContext:1.0
{
  If RI is defined into the Interface Repository
     (i.e. the RI.idl file was fed into the IR) then
  {
    if RI inherits from IDL:omg.org/CosNaming/NamingContext:1.0 then
    {
      the type of the RO is RI
    }
    else # RI does not inherit from IDL:omg.org/CosNaming/NamingContext:1.0
    {
      this is a type error: RO does not denote a Name Service.
    }
  }
  else # RI is not defined into the Interface Repository
  {
    # Calls the distant object to ask him is a Name Service
    if RO._is_a( IDL:omg.org/CosNaming/NamingContext:1.0 ) then
    {
      the type of the RO is CosNaming::NamingContext
    }
    else
    {
      this is a type error: RO does not denote a Name Service.
    }
  }
}
      
