Exception: RBS::DuplicatedMethodDefinitionError
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
DefinitionError ,
BaseError ,
StandardError
|
|
Instance Chain:
self,
DefinitionError ,
BaseError ,
StandardError
|
|
Inherits: |
RBS::DefinitionError
|
Defined in: | lib/rbs/errors.rb |
Class Method Summary
Instance Attribute Summary
- #members readonly
- #method_name readonly
- #type readonly
Instance Method Summary
Constructor Details
.new(type:, method_name:, members:) ⇒ DuplicatedMethodDefinitionError
# File 'lib/rbs/errors.rb', line 236
def initialize(type:, method_name:, members:) @type = type @method_name = method_name @members = members = +"#{Location.to_string location}: #{qualified_method_name} has duplicated definitions" if members.size > 1 << " in #{other_locations.map { |loc| Location.to_string loc }.join(', ')}" end super end
Instance Attribute Details
#members (readonly)
[ GitHub ]# File 'lib/rbs/errors.rb', line 234
attr_reader :members
#method_name (readonly)
[ GitHub ]# File 'lib/rbs/errors.rb', line 233
attr_reader :method_name
#type (readonly)
[ GitHub ]# File 'lib/rbs/errors.rb', line 232
attr_reader :type
Instance Method Details
#location
[ GitHub ]# File 'lib/rbs/errors.rb', line 261
def location members[0].location end
#other_locations
[ GitHub ]#qualified_method_name
[ GitHub ]# File 'lib/rbs/errors.rb', line 248
def qualified_method_name case type when Types::ClassSingleton "#{type.name}.#{method_name}" else "#{type.name}##{method_name}" end end
#type_name
[ GitHub ]# File 'lib/rbs/errors.rb', line 257
def type_name type.name end