class Steep::AST::Types::Name::Class
def ==(other)
def ==(other) other.class == self.class && other.name == name && other.constructor == constructor end
def hash
def hash self.class.hash ^ name.hash ^ constructor.hash end
def initialize(name:, constructor:, location: nil)
def initialize(name:, constructor:, location: nil) raise "Name should be a module name: #{name.inspect}" unless name.is_a?(Names::Module) super(name: name, location: location) @constructor = constructor end
def to_instance(*args)
def to_instance(*args) Instance.new(name: name, args: args) end
def to_s
def to_s k = case constructor when true " constructor" when false " noconstructor" when nil "" end "singleton(#{name.to_s})" end
def updated(constructor: NOTHING)
def updated(constructor: NOTHING) if NOTHING == constructor constructor = self.constructor end self.class.new(name: name, constructor: constructor, location: location) end
def with_location(new_location)
def with_location(new_location) self.class.new(name: name, constructor: constructor, location: new_location) end