Exception: RBS::DuplicatedDeclarationError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, *decls) ⇒ DuplicatedDeclarationError

Returns a new instance of DuplicatedDeclarationError.



298
299
300
301
302
303
304
# File 'lib/rbs/errors.rb', line 298

def initialize(name, *decls)
  @name = name
  @decls = decls

  last_decl = decls.last or raise
  super "#{Location.to_string last_decl.location}: Duplicated declaration: #{name}"
end

Instance Attribute Details

#declsObject (readonly)

Returns the value of attribute decls.



296
297
298
# File 'lib/rbs/errors.rb', line 296

def decls
  @decls
end

#nameObject (readonly)

Returns the value of attribute name.



295
296
297
# File 'lib/rbs/errors.rb', line 295

def name
  @name
end