Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::Pattern#compile_constant_read_node
compile_constant_read_node(node)
lib/prism/pattern.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/prism/pattern.rb, line 153
def compile_constant_read_node(node)
value = node.slice
if Prism.const_defined?(value, false)
clazz = Prism.const_get(value)
->(other) { clazz === other }
elsif Object.const_defined?(value, false)
clazz = Object.const_get(value)
->(other) { clazz === other }
else
compile_error(node)
end
end
in ConstantReadNode in String