diff --git a/src/stv/options.rs b/src/stv/options.rs index e14ec82..1c821d6 100644 --- a/src/stv/options.rs +++ b/src/stv/options.rs @@ -248,9 +248,19 @@ 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.immediate_elect { + if 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.quota_mode == QuotaMode::ERS97 { + // Invalid because candidates meeting the VRE never have surpluses distributed + return Err(STVError::InvalidOptions("--no-immediate-elect is incompatible with --quota-mode ers97")); + } + if self.quota_mode == QuotaMode::ERS76 { + // Invalid because candidates meeting the VRE never have surpluses distributed + return Err(STVError::InvalidOptions("--no-immediate-elect is incompatible with --quota-mode ers76")); + } } if self.min_threshold != "0" && self.defer_surpluses { // TODO: NYI