Exception: RBS::RecursiveAliasDefinitionError

Inherits:
DefinitionError 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(type:, defs:) ⇒ RecursiveAliasDefinitionError

Returns a new instance of RecursiveAliasDefinitionError.



414
415
416
417
418
419
# File 'lib/rbs/errors.rb', line 414

def initialize(type:, defs:)
  @type = type
  @defs = defs

  super "#{Location.to_string location}: Recursive aliases in #{type}: #{defs.map(&:name).join(", ")}"
end

Instance Attribute Details

#defsObject (readonly)

Returns the value of attribute defs.



412
413
414
# File 'lib/rbs/errors.rb', line 412

def defs
  @defs
end

#typeObject (readonly)

Returns the value of attribute type.



411
412
413
# File 'lib/rbs/errors.rb', line 411

def type
  @type
end

Instance Method Details

#locationObject



421
422
423
424
425
# File 'lib/rbs/errors.rb', line 421

def location
  first_def = defs.first or raise
  original = first_def.original or raise
  original.location
end