Exception: RBS::CyclicClassAliasDefinitionError

Inherits:
BaseError
  • Object
show all
Includes:
DetailedMessageable
Defined in:
lib/rbs/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DetailedMessageable

#detailed_message

Constructor Details

#initialize(entry) ⇒ CyclicClassAliasDefinitionError

Returns a new instance of CyclicClassAliasDefinitionError.



558
559
560
561
562
# File 'lib/rbs/errors.rb', line 558

def initialize(entry)
  @alias_entry = entry

  super "#{Location.to_string(entry.decl.location&.[](:old_name))}: A #{alias_entry.decl.new_name} is a cyclic definition"
end

Instance Attribute Details

#alias_entryObject (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

#locationObject



564
565
566
# File 'lib/rbs/errors.rb', line 564

def location
  @alias_entry.decl.location
end