Method: RBS::DuplicatedMethodDefinitionError#initialize

Defined in:
lib/rbs/errors.rb

#initialize(type:, method_name:, members:) ⇒ DuplicatedMethodDefinitionError

Returns a new instance of DuplicatedMethodDefinitionError.



258
259
260
261
262
263
264
265
266
267
268
# File '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