{"record":{"id":"9917098fe2094a00","repo":"puppetlabs/puppet","slug":"a-numeric-is-not-comparable-to-non-numeric","errorCode":null,"errorMessage":"A Numeric is not comparable to non Numeric","messagePattern":"A Numeric is not comparable to non Numeric","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/compare_operator.rb","lineNumber":70,"sourceCode":"\n    raise ArgumentError, _(\"A String is not comparable to a non String\")\n  end\n\n  # Equality is case independent.\n  def equals_String(a, b)\n    return false unless b.is_a?(String)\n\n    a.casecmp(b) == 0\n  end\n\n  def cmp_Numeric(a, b)\n    case b\n    when Numeric\n      a <=> b\n    when Time::Timespan, Time::Timestamp\n      -(b <=> a) # compare other way and invert result\n    else\n      raise ArgumentError, _(\"A Numeric is not comparable to non Numeric\")\n    end\n  end\n\n  def equals_Numeric(a, b)\n    if b.is_a?(Numeric)\n      a == b\n    else\n      false\n    end\n  end\n\n  def equals_Array(a, b)\n    return false unless b.is_a?(Array) && a.size == b.size\n\n    a.each_index { |i| return false unless equals(a.slice(i), b.slice(i)) }\n    true\n  end\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/compare_operator.rb#L52-L88","documentation":"Error \"A Numeric is not comparable to non Numeric\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/compare_operator.rb:70 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":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}