Skip to content

Add the Warning module - #458

Merged
tannevaled merged 1 commit into
mainfrom
feat/cluster28
Aug 25, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/cluster28

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Warning was an uninitialized constant. It is now defined in the prelude as the
module Ruby routes warnings through:

  • Warning.[](category) / Warning.[]=(category, flag) read and toggle whether a
    category's warnings are enabled — :deprecated (false), :experimental (true),
    :performance (false) and :strict_unused_block (false) by default. A
    non-Symbol category raises TypeError and an unknown one ArgumentError.
  • Warning.categories lists the known categories.
  • Warning.warn writes its message to $stderr unchanged and returns nil; it is
    a module function (extend self) owned by Warning, so a program can override
    it by redefining Warning.warn.

Verified against ruby 4.0.6. Full package coverage stays at 100.0% (the
frozen prelude was regenerated). Zero-regression rubyspec sweep;
core/warning/{element_reference +2, element_set +3, warn +3,
categories +1}. (The remaining warn_spec examples require Kernel#warn to
route through Warning.warn and the parser to emit through it — separate
follow-ups — or use ruby_exe subprocesses the harness skips.)

🤖 Generated with Claude Code

Warning was an uninitialized constant. It is now defined in the prelude as the
module Ruby routes warnings through:

  - Warning.[](category) / Warning.[]=(category, flag) read and toggle whether a
    category's warnings are enabled — :deprecated (false), :experimental (true),
    :performance (false) and :strict_unused_block (false) by default. A non-Symbol
    category raises TypeError and an unknown one ArgumentError.
  - Warning.categories lists the known categories.
  - Warning.warn writes its message to $stderr unchanged and returns nil; it is a
    module function (extend self) owned by Warning, so a program can override it
    by redefining Warning.warn.

Verified against ruby 4.0.6. Full package coverage stays at 100.0% (the frozen
prelude was regenerated). Zero-regression rubyspec sweep; core/warning/
{element_reference +2, element_set +3, warn +3, categories +1}. (The remaining
warn_spec examples require Kernel#warn to route through Warning.warn and the
parser to emit through it — separate follow-ups — or use ruby_exe subprocesses
the harness skips.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit adacfa5 into main Aug 25, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/cluster28 branch August 25, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant