class RBS::InconsistentClassModuleAliasError

Attributes

alias_entry[R]

Public Class Methods

new(entry) click to toggle source
Calls superclass method
# File rbs-3.1.0/lib/rbs/errors.rb, line 519
def initialize(entry)
  @alias_entry = entry

  expected_kind, actual_kind =
    case entry
    when Environment::ModuleAliasEntry
      ["module", "class"]
    when Environment::ClassAliasEntry
      ["class", "module"]
    end

  super "#{Location.to_string(entry.decl.location&.[](:old_name))}: A #{expected_kind} `#{entry.decl.new_name}` cannot be an alias of a #{actual_kind} `#{entry.decl.old_name}`"
end

Public Instance Methods

location() click to toggle source
# File rbs-3.1.0/lib/rbs/errors.rb, line 533
def location
  @alias_entry.decl.location
end