Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added type definitions for float, _ToRange[T], range[T], and interned #1469

Merged

Conversation

sampersand
Copy link
Contributor

@sampersand sampersand commented Aug 25, 2023

This adds in the _Range[T] interface, and range[T], float, and interned aliases.

  • _Range[T] is the Range equivalent of _ToInt, and is used in many places.
  • range[T] is an alias for Range[T] | _Range[T], akin to string and int.
  • float is an alias for Float | _ToF, which is used in quite a few places (eg Regexp#timeout=)
  • interned is an alias for Symbol | string, which is frequently used, even in unexpected areas (eg Regexp#=~)

Note that I used interned instead of id, as I suspect people'll be much more likely to define id aliases, and find conflicts, than interned.

@sampersand sampersand marked this pull request as ready for review August 25, 2023 21:01
@sampersand sampersand force-pushed the swesterman/23-08-25/add-other-builtins branch 3 times, most recently from 25c401e to f5e2bc8 Compare August 26, 2023 04:59
@soutaro soutaro added this to the RBS 3.3 milestone Aug 29, 2023
@soutaro soutaro force-pushed the swesterman/23-08-25/add-other-builtins branch from f5e2bc8 to 67e6474 Compare August 29, 2023 05:20
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@soutaro soutaro enabled auto-merge August 29, 2023 05:21
@soutaro soutaro added this pull request to the merge queue Aug 29, 2023
Merged via the queue into ruby:master with commit 0393f25 Aug 29, 2023
@soutaro soutaro added the Released PRs already included in the released version label Oct 31, 2023
m11o added a commit to m11o/gem_rbs that referenced this pull request Jan 29, 2024
`interned` is defined as alias for `Symbol | string` in RBS 3.3.
ref: ruby/rbs#1469
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

2 participants