Summary
empty() still accepts Numeric values for backwards compatibility, emits a deprecation warning, and returns false instead of raising a type error.
Evidence
lib/puppet/functions/empty.rb:67 calls deprecation_warning_for('Numeric').
lib/puppet/functions/empty.rb:84 warning text: Calling function empty() with Numeric value is deprecated.
lib/puppet/functions/empty.rb:68 returns false for Numeric.
- Header docs in
lib/puppet/functions/empty.rb:12 mark Numeric/Undef compatibility as deprecated.
Proposed OpenVox 9 Change
- Remove
Numeric dispatch from empty().
- Make
empty(<Numeric>) fail with standard type/signature error.
Compatibility / Risk
- Medium risk for manifests using
empty(0)-style checks.
- Recommended migration is explicit checks, for example:
value =~ Numeric or
value == undef or
value == '' / value.empty depending on expected type.
Implementation Notes
- Remove
dispatch :numeric_empty and numeric_empty implementation.
- Remove Numeric-specific deprecation warning helper usage.
- Keep or separately evaluate
Undef compatibility behavior (tracked independently).
- Update function reference docs/signatures.
Acceptance Criteria
empty() no longer accepts Numeric.
- No Numeric deprecation warning path remains in function implementation.
- Type/signature error is emitted for numeric input.
Suggested Tests
- Unit test ensuring
empty(1) raises signature/type mismatch.
- Regression tests for supported inputs (
Collection, String, Sensitive[String], Binary).
Summary
empty()still acceptsNumericvalues for backwards compatibility, emits a deprecation warning, and returnsfalseinstead of raising a type error.Evidence
lib/puppet/functions/empty.rb:67callsdeprecation_warning_for('Numeric').lib/puppet/functions/empty.rb:84warning text:Calling function empty() with Numeric value is deprecated.lib/puppet/functions/empty.rb:68returnsfalseforNumeric.lib/puppet/functions/empty.rb:12mark Numeric/Undef compatibility as deprecated.Proposed OpenVox 9 Change
Numericdispatch fromempty().empty(<Numeric>)fail with standard type/signature error.Compatibility / Risk
empty(0)-style checks.value =~ Numericorvalue == undeforvalue == ''/value.emptydepending on expected type.Implementation Notes
dispatch :numeric_emptyandnumeric_emptyimplementation.Undefcompatibility behavior (tracked independently).Acceptance Criteria
empty()no longer acceptsNumeric.Suggested Tests
empty(1)raises signature/type mismatch.Collection,String,Sensitive[String],Binary).