Skip to content

馃 Improved SequenceSet implicit integer coercion - #783

Merged
nevans merged 1 commit into
masterfrom
sequence_set/integer-argument-conversion
Oct 10, 2026
Merged

nevans merged 1 commit into
masterfrom
sequence_set/integer-argument-conversion

Conversation

@nevans

@nevans nevans commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

This gives errors that are a little bit closer to ruby core and stdlib, when implicit integer arguments are expected.

Unfortunately, although ruby's CAPI handles this (via macros like NUM2LONG), ruby doesn't expose a standard ruby API to do it!

In addition to raising errors that are more similar to core ruby APIs, this also handles nil arguments differently from unsent arguments.

This gives errors that are a little bit closer to ruby core and stdlib,
when implicit integer arguments are expected.

Unfortunately, although ruby's CAPI handles this (via macros like
`NUM2LONG`), ruby doesn't expose a standard _ruby_ API to do it!

In addition to raising errors that are more similar to core ruby APIs,
this also handles `nil` arguments differently from unsent arguments.
@nevans nevans added the enhancement New feature or request label Oct 10, 2026
Base automatically changed from sequence_set/fix-slice-with-negative-length to master October 10, 2026 03:25
@nevans
nevans merged commit 1b55a81 into master Oct 10, 2026
33 of 34 checks passed
@nevans
nevans deleted the sequence_set/integer-argument-conversion branch October 10, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant