Skip to content

#1424: dup the String of Symbol#to_s in PTerm#to_p, so gsub! doesn't change a chilled String - #1460

Open
jack5505 wants to merge 1 commit into
zerocracy:masterfrom
jack5505:1424
Open

jack5505 wants to merge 1 commit into
zerocracy:masterfrom
jack5505:1424

Conversation

@jack5505

@jack5505 jack5505 commented Oct 8, 2026

Copy link
Copy Markdown

PTerm#to_p took the String of Symbol#to_s and changed it with gsub!. Since Ruby 3.4 that String is "chilled": the change still works, but prints string returned by :b1.to_s will be frozen in the future, and a later Ruby will raise FrozenError. Every variable name of every bylaw goes through this line, so with test.warning = true the build log was full of these warnings.

to_p now works on a copy, any.to_s.dup. Added a test that turns the deprecation warnings on, renders a bylaw and expects nothing on stderr; it fails without the fix.

Closes #1424

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.

Fbe::Award::PTerm#to_p calls gsub! on the String of Symbol#to_s, which Ruby warns will be frozen

1 participant