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

Fix eval'ed constants not being generated in gem RBI generation #589

Merged
merged 2 commits into from
Nov 3, 2021

Conversation

paracycle
Copy link
Member

Motivation

Fixes #537

Implementation

For eval'ed classes/modules, the path attribute of the TracePoint object ends up being "(eval)", which does not help us figure out where the class/module is being defined.

Instead, we can look back up the call stack until we find the first caller location that has a path that is not equal to (eval)" which is where the call is ultimately being made from.

Tests

Added a failing test that passes after the fix.

@paracycle paracycle requested review from KaanOzkan and a team November 3, 2021 19:55
For eval'ed classes/modules, the `path` attribute of the TracePoint
object ends up being `"(eval)"`, which does not help us figure out
where the class/module is being defined.

Instead, we can look back up the call stack until we find the first
caller location that has a `path` that is not equal to `"(eval)"` which
is where the call is ultimately being made from.
@paracycle paracycle merged commit 094f347 into main Nov 3, 2021
@paracycle paracycle deleted the uk-fix-evaled-constants branch November 3, 2021 21:08
@paracycle paracycle added the backported Backported to stable branch label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Backported to stable branch bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typecheck failed when using activeadmin
5 participants