Closed herwinw closed 4 months ago
With the power of $stderr.puts
sprinkled in your code (who needs a debugger):
{:CONST=>0, "CONST"=>1}
ConstFindInstruction
calls to_sym
on the input, ConstSetInstruction
calls to_s
So I guess we should fix this using https://api.rubyonrails.org/classes/ActiveSupport/HashWithIndifferentAccess.html (grabs popcorn)
I was just looking at the generated code for
CONST ||= 1; 2
(the; 2
is to turn the used mode off, I guess the last line is always used. This is without #2047, but the same things happens with that PR):The two calls to
const_find_with_autoload
both use the first symbol, whe call toconst_set
uses the second one. Both symbols are the same, and the code is created by the samenode.name
calls. So we should be able to merge these two values.