pub enum PlanError {
ConflictingVariableType {
var: String,
first_predicate: String,
first_position: usize,
first_type: ScalarType,
second_predicate: String,
second_position: usize,
second_type: ScalarType,
},
InferenceConflict {
predicate: String,
column: usize,
first_rule_index: usize,
first_type: ScalarType,
second_rule_index: usize,
second_type: ScalarType,
},
RuleHeadPredicateMismatch {
group_key: String,
rule_index: usize,
observed: String,
},
}Expand description
Hard errors from plan_rule / plan_rules / plan_scc_rules.
Distinct from RulePlan::BinaryFallback: a fallback verdict
means the rule is plannable, just on a different path. A plan
error means the rule cannot be planned at all under the
current fixture and must be fixed by the caller.
Variants§
ConflictingVariableType
Same shape as RefEvalError::ConflictingVariableType.
Mirrored here (rather than re-exporting the eval-error
variant) so the planner’s error type is independent of the
evaluator’s.
Fields
first_type: ScalarTypeSchema type at (first_predicate, first_position).
second_type: ScalarTypeSchema type at (second_predicate, second_position).
InferenceConflict
Cross-rule head-column conflict detected during PR 8 SCC type inference. Two rules contributing to the same head predicate disagree on the type of the same column.
Mirrors RefEvalError::InferenceConflict so callers
pattern-matching on plan errors can treat inference and
eval conflicts symmetrically. Surfaced only by
plan_scc_rules; per-rule plan_rule / plan_rules
don’t run inference (no group context).
Fields
first_type: ScalarTypeType derived from the first rule’s body.
second_type: ScalarTypeType derived from the conflicting rule’s body.
RuleHeadPredicateMismatch
A rule grouped under predicate group_key heads a
different predicate. Surfaces from plan_scc_rules only;
per-rule plan_rule / plan_rules don’t have group
context to validate against.
Mirrors super::SccFixpointError::RuleHeadPredicateMismatch
so the planner and the SCC fixpoint evaluator agree on the
diagnostic for this fixture class. Without symmetry, a
caller driving plan-then-evaluate would see the planner
say “MultiwayCandidate” while the evaluator says
“RuleHeadPredicateMismatch” — the same disagreement
pattern PR 9 closed for unsupported-key cases.