The simplest way to do so, would be to rename the third argument in remove_unit to non_terminal_unit, then have special logic in the switch statement in fetch to handle non_terminal_unit. (This means that the generator could generate plans that use the non_terminal_unit selector).
A more extensive refactor would be to rename the third argument to target, and then base the switch statement in fetch on the type annotation for the parameter passed to target, rather than the argument name.
This replaces the current check inside of remove_unit.
Came up in a meeting w/ @abentley
The simplest way to do so, would be to rename the third argument in
remove_unit
tonon_terminal_unit
, then have special logic in the switch statement in fetch to handlenon_terminal_unit
. (This means that the generator could generate plans that use thenon_terminal_unit
selector).A more extensive refactor would be to rename the third argument to
target
, and then base the switch statement infetch
on the type annotation for the parameter passed totarget
, rather than the argument name.This replaces the current check inside of remove_unit.