Skip to content

Fix for #7656.#7659

Merged
enebo merged 9 commits intojruby:masterfrom
enebo:fix_7656
Feb 15, 2023
Merged

Fix for #7656.#7659
enebo merged 9 commits intojruby:masterfrom
enebo:fix_7656

Conversation

@enebo
Copy link
Member

@enebo enebo commented Feb 13, 2023

This will fix top-level error for class variables as reported in #7656. There is now an issue that eval("@@a = 1") will not raise. This is a much more minor issue. I will take some more time to try and come up with a more encompassing fix but even if I don't this is a good trade.

This will fix top-level error for class variables as reported
in jruby#7656.  There is now an issue that ```eval("@@A = 1")```
will not raise.  This is a much more minor issue.  I will
take some more time to try and come up with a more encompassing
fix but even if I don't this is a good trade.
@enebo enebo added this to the JRuby 9.4.2.0 milestone Feb 13, 2023
Examination of scopes seems to be enough to pass things.
So much logic mangling around evalType such that I just assign
it as field to IRBuilder.  Once I did that I then realized a plain
eval without a binding still comes in as a binding eval (which
is somewhat true since it makes a default binding at that callsite).
This binding property is problemative as a binding is a live value.

The solution is to just not enforce this error if you pass in
an explicit binding.  The error itself is of questionable value
and doing a cvar action in an eval with a top-level binding just
seems like uncommon on uncommon.

This could get fixed since the live binding has info we can examine
but we do not say topself in runtime structures directly (e.g. cref
will be Object, self will not be either???).  Does not feel worth it.
We need to make sure if eval is happening within a module/class scope we
do not consider it top self eval.
all subtypes of core types now return their base types.
@enebo enebo merged commit e9abdf1 into jruby:master Feb 15, 2023
@enebo enebo deleted the fix_7656 branch February 15, 2023 21:37
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.

1 participant