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

Updated control flow type definitions #1444

Merged

Conversation

sampersand
Copy link
Contributor

@sampersand sampersand commented Aug 19, 2023

Update Kernel "control flow" method definitions:

  • catch: (nothing to do)
  • throw: make the tag untyped
  • at_exit: block return type is void
  • exit and exit!: use bool instead of TrueClass | FalseClass; Also, use int instead of Integer for status
  • fork: block return type is void, return type in block form is no longer Integer? but just Integer
  • loop: block return type is void
  • sleep: Add in support for Ruby-3.3.0 preview's sleep(nil)
  • raise / fail: Add support for raise has_a_to_str_method, Made the message in the long-form _ToS, and allow for nil and String backtraces.

Technically, the message in the long form can be any type, as long as the first argument's exception function allows for it. So, we could do [T] (_Exception[T], ?T?, ..., but that seems like overkill. (Especially since _Exception is used in Thread and Fiber. Maybe when I get around to I could change the signature?)

@sampersand sampersand marked this pull request as ready for review August 19, 2023 04:55
@sampersand sampersand force-pushed the swesterman/23-08-18/kernel-control-flow branch from 5878395 to 1f13861 Compare August 19, 2023 22:12
@sampersand sampersand mentioned this pull request Aug 19, 2023
@sampersand sampersand force-pushed the swesterman/23-08-18/kernel-control-flow branch from 1f13861 to 724d5f7 Compare August 21, 2023 19:58
@soutaro soutaro modified the milestones: RBS 3.3, RBS 3.2 Aug 22, 2023
core/kernel.rbs Outdated Show resolved Hide resolved
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.

Extra empty line breaks the CI.

@sampersand sampersand force-pushed the swesterman/23-08-18/kernel-control-flow branch from 724d5f7 to 706c95f Compare August 22, 2023 01:32
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 added this pull request to the merge queue Aug 22, 2023
Merged via the queue into ruby:master with commit 4f40cf4 Aug 22, 2023
22 of 23 checks passed
@soutaro soutaro added the Released PRs already included in the released version label Aug 22, 2023
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