From f18797560119aae4911bdbb9d4b20fdff8ae9723 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sat, 2 Jul 2022 23:46:02 +1000 Subject: [PATCH] --no-immediate-elect requires --surplus-order by_size --- src/stv/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stv/mod.rs b/src/stv/mod.rs index f2916aa..dc951c8 100644 --- a/src/stv/mod.rs +++ b/src/stv/mod.rs @@ -266,6 +266,10 @@ impl STVOptions { return Err(STVError::InvalidOptions("--subtract-nontransferable requires --transferable-only")); } } + if !self.immediate_elect && self.surplus_order != SurplusOrder::BySize { + // Invalid because there is no other metric to determine which surplus to distribute + return Err(STVError::InvalidOptions("--no-immediate-elect requires --surplus-order by_size")); + } if self.min_threshold != "0" && self.defer_surpluses { // TODO: NYI return Err(STVError::InvalidOptions("--min-threshold is incompatible with --defer-surpluses (not yet implemented)"));