123456789_123456789_123456789_123456789_123456789_

Exception: RBS::DuplicatedInterfaceMethodDefinitionError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, DefinitionError, ErrorBase, StandardError
Instance Chain:
self, DefinitionError, ErrorBase, StandardError
Inherits: RBS::DefinitionError
Defined in: lib/rbs/errors.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(type:, method_name:, member:) ⇒ DuplicatedInterfaceMethodDefinitionError

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 226

def initialize(type:, method_name:, member:)
  @type = type
  @method_name = method_name
  @member = member

  super "#{member.location}: Duplicated method definition: #{qualified_method_name}"
end

Instance Attribute Details

#member (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 224

attr_reader :member

#method_name (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 223

attr_reader :method_name

#type (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 222

attr_reader :type

Instance Method Details

#qualified_method_name

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 234

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 243

def type_name
  type.name
end