{"record":{"id":"f03b98d3ad679ac3","repo":"ruby/rubygems","slug":"self-and-other-have-different-names","errorCode":null,"errorMessage":"#{self} and #{other} have different names","messagePattern":"#(.+?) and #(.+?) have different names","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/dependency.rb","lineNumber":259,"sourceCode":"  # Does this dependency match +spec+?\n  #\n  # NOTE:  This is not a convenience method.  Unlike #match? this method\n  # returns true when +spec+ is a prerelease version even if this dependency\n  # is not a prerelease dependency.\n\n  def matches_spec?(spec)\n    return false unless name === spec.name\n    return true  if requirement.none?\n\n    requirement.satisfied_by?(spec.version)\n  end\n\n  ##\n  # Merges the requirements of +other+ into this dependency\n\n  def merge(other)\n    unless name == other.name\n      raise ArgumentError,\n            \"#{self} and #{other} have different names\"\n    end\n\n    default = Gem::Requirement.default\n    self_req = requirement\n    other_req = other.requirement\n\n    return self.class.new name, self_req  if other_req == default\n    return self.class.new name, other_req if self_req  == default\n\n    self.class.new name, self_req.as_list.concat(other_req.as_list)\n  end\n\n  def matching_specs(platform_only = false)\n    matches = Gem::Specification.find_all_by_name(name, requirement)\n\n    if platform_only\n      matches.reject! do |spec|","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/dependency.rb#L241-L277","documentation":"Error \"#{self} and #{other} have different names\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/dependency.rb:259 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}