class Prism::Pattern

def compile_constant_name(node, name)

Compile a name associated with a constant.
def compile_constant_name(node, name)
  if Prism.const_defined?(name, false)
    clazz = Prism.const_get(name)
    ->(other) { clazz === other }
  elsif Object.const_defined?(name, false)
    clazz = Object.const_get(name)
    ->(other) { clazz === other }
  else
    compile_error(node)
  end
end