Skip to content

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