Exception: RBS::InconsistentClassModuleAliasError
- Includes:
- DetailedMessageable
- Defined in:
- lib/rbs/errors.rb
Instance Attribute Summary collapse
-
#alias_entry ⇒ Object
readonly
Returns the value of attribute alias_entry.
Instance Method Summary collapse
-
#initialize(entry) ⇒ InconsistentClassModuleAliasError
constructor
A new instance of InconsistentClassModuleAliasError.
- #location ⇒ Object
Methods included from DetailedMessageable
Constructor Details
#initialize(entry) ⇒ InconsistentClassModuleAliasError
Returns a new instance of InconsistentClassModuleAliasError.
558 559 560 561 562 563 564 565 566 567 568 569 570 |
# File 'lib/rbs/errors.rb', line 558 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 ⇒ Object (readonly)
Returns the value of attribute alias_entry.
556 557 558 |
# File 'lib/rbs/errors.rb', line 556 def alias_entry @alias_entry end |
Instance Method Details
#location ⇒ Object
572 573 574 |
# File 'lib/rbs/errors.rb', line 572 def location @alias_entry.decl.location end |