diff --git a/src/proc/constant_evaluator.rs b/src/proc/constant_evaluator.rs index c3796ccc69..61adf0fdd5 100644 --- a/src/proc/constant_evaluator.rs +++ b/src/proc/constant_evaluator.rs @@ -1158,9 +1158,11 @@ impl<'a> ConstantEvaluator<'a> { expr: Expression, span: Span, ) -> Result, ConstantEvaluatorError> { - match expr { - Expression::Literal(literal) => crate::valid::validate_literal(literal)?, - _ => {} + // It suffices to only check literals, since we only register one + // expression at a time, `Compose` expressions can only refer to other + // expressions, and `ZeroValue` expressions are always okay. + if let Expression::Literal(literal) = expr { + crate::valid::validate_literal(literal)?; } if let Some(FunctionLocalData {