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

Incompatability with symbol-fstring #102

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

Conversation

ghiculescu
Copy link
Contributor

@ghiculescu ghiculescu commented Feb 21, 2024

An incompability exists with https://github.com/Shopify/symbol-fstring. I'm not sure if the bug is in this gem or that one, but it's easier to make a test case here and I think the bug is here.

The attached test fails, but it passes if you remove the extra gem. It fails because with the gem, const_name is frozen? here. As a result this line raises a FrozenError, and that gets handled here.

This is only an issue when loading a namespaced constant.

I've only made a test case as I don't really know how to fix it :(

@ghiculescu
Copy link
Contributor Author

cc @byroot in case this is an issue in symbol-fstring (I doubt that) or in case you have some good ideas on how to fix this.

@byroot
Copy link

byroot commented Feb 21, 2024

const_name is a symbol here, so Symbol#to_s returns a frozen string when symbol-fstring is present, which is expected.

Amusingly that the first ever recorded incompatibility I'm aware of with it, but as I said, totally expected as it's a monkey patch that changes the behavior.

As for fixing it, explictly using const_name.name.dup would work.

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.

2 participants