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

Restore Ruby 3.4 compatibility in T::Props::Serializable #7779

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

casperisfine
Copy link
Contributor

Followup: #7778
Followup: #7710

Exceptions are not guaranteed to have a #backtrace_locations because of Exception#set_backtrace and Kernel#raise(error, message, backtrace).

It's still prefereable to use #backtrace_location when present as it requires much less string parsing.

But if it's missing we can fallback to parse backtraces the old way, however we need to account for Ruby 3.4 newer format.

@froydnj @jez @paracycle

@casperisfine casperisfine requested a review from a team as a code owner March 22, 2024 08:39
@casperisfine casperisfine requested review from ilyailya and removed request for a team March 22, 2024 08:39
Copy link
Contributor

@froydnj froydnj left a comment

Choose a reason for hiding this comment

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

Thank you for the patch!

gems/sorbet-runtime/lib/types/props/serializable.rb Outdated Show resolved Hide resolved
Followup: sorbet#7778
Followup: sorbet#7710

Exceptions are not guaranteed to have a `#backtrace_locations` because
of `Exception#set_backtrace` and `Kernel#raise(error, message, backtrace)`.

It's still prefereable to use `#backtrace_location` when present
as it requires much less string parsing.

But if it's missing we can fallback to parse backtraces the old way,
however we need to account for Ruby 3.4 newer format.
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.

None yet

3 participants