class RBS::DuplicatedMethodDefinitionError
Attributes
members
[R]
Array[original]
type
[R]
ty
Public Class Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 258 def initialize(type:, method_name:, members:) @type = type @method_name = method_name @members = members message = +"#{Location.to_string location}: #{qualified_method_name} has duplicated definitions" if members.size > 1 message << " in #{other_locations.map { |loc| Location.to_string loc }.join(', ')}" end super message end
Calls superclass method
Exception::new
Public Instance Methods
() → Location[untyped, untyped]?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 283 def location members[0].location end
() → Array[Location[untyped, untyped]?]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 287 def other_locations members.drop(1).map(&:location) end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 270 def qualified_method_name case type when Types::ClassSingleton "#{type.name}.#{method_name}" else "#{type.name}##{method_name}" end end
() → TypeName
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 279 def type_name type.name end