pullUpTypedInterface<InterfaceType extends PairInterface> method

InterfaceReference<InterfaceType> pullUpTypedInterface<InterfaceType extends PairInterface>(
  1. InterfaceReference<InterfaceType> subModuleIntf, {
  2. String? newIntfName,
  3. bool allowIntfUniquification = true,
  4. String portUniquify(
    1. String logical,
    2. String physical
    )?,
})

Pulls subModuleIntf up while preserving InterfaceType.

This delegates hierarchy traversal and connection behavior to pullUpInterface. Port exclusions are intentionally unavailable because removing ports changes the concrete interface type.

Implementation

InterfaceReference<InterfaceType>
    pullUpTypedInterface<InterfaceType extends PairInterface>(
  InterfaceReference<InterfaceType> subModuleIntf, {
  String? newIntfName,
  bool allowIntfUniquification = true,
  String Function(String logical, String physical)? portUniquify,
}) {
  final pulledUpInterface = pullUpInterface(
    subModuleIntf,
    newIntfName: newIntfName,
    allowIntfUniquification: allowIntfUniquification,
    portUniquify: portUniquify,
  );

  if (pulledUpInterface is! InterfaceReference<InterfaceType>) {
    throw RohdBridgeException(
        'Pulling up ${subModuleIntf.name} did not preserve '
        '$InterfaceType.');
  }

  return pulledUpInterface;
}