Skip to content

[Deprecation] empty() Numeric Compatibility #346

@silug

Description

@silug

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecationThis issue pertains to an item/topic which has been deprecated.

    Type

    No type

    Projects

    Status

    Deprecated

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions