Exception: RBS::RecursiveAliasDefinitionError

Inherits:
DefinitionError 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.



377
378
379
380
381
382
# File 'lib/rbs/errors.rb', line 377

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.



375
376
377
# File 'lib/rbs/errors.rb', line 375

def defs
  @defs
end

#typeObject (readonly)

Returns the value of attribute type.



374
375
376
# File 'lib/rbs/errors.rb', line 374

def type
  @type
end

Instance Method Details

#locationObject



384
385
386
387
388
# File 'lib/rbs/errors.rb', line 384

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