123456789_123456789_123456789_123456789_123456789_

Exception: RBS::InconsistentClassModuleAliasError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, BaseError, StandardError
Instance Chain:
self, DetailedMessageable, BaseError, StandardError
Inherits: RBS::BaseError
Defined in: lib/rbs/errors.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(entry) ⇒ InconsistentClassModuleAliasError

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 534

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

Instance Attribute Details

#alias_entry (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 532

attr_reader :alias_entry

Instance Method Details

#location

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 548

def location
  @alias_entry.decl.location
end