Exception: RBS::RecursiveAliasDefinitionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rbs/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, defs:) ⇒ RecursiveAliasDefinitionError

Returns a new instance of RecursiveAliasDefinitionError.



322
323
324
325
326
327
# File 'lib/rbs/errors.rb', line 322

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.



320
321
322
# File 'lib/rbs/errors.rb', line 320

def defs
  @defs
end

#typeObject (readonly)

Returns the value of attribute type.



319
320
321
# File 'lib/rbs/errors.rb', line 319

def type
  @type
end

Instance Method Details

#locationObject



329
330
331
332
333
# File 'lib/rbs/errors.rb', line 329

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