{"record":{"id":"0f278921d79c8d53","repo":"puppetlabs/puppet","slug":"only-strings-numbers-timespans-timestamps-and","errorCode":null,"errorMessage":"Only Strings, Numbers, Timespans, Timestamps, and Versions are comparable","messagePattern":"Only Strings, Numbers, Timespans, Timestamps, and Versions are comparable","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/compare_operator.rb","lineNumber":123,"sourceCode":"    raise ArgumentError, _('Timespans are only comparable to Timespans, Integers, and Floats') unless b.is_a?(Time::Timespan) || b.is_a?(Integer) || b.is_a?(Float)\n\n    a <=> b\n  end\n\n  def cmp_Timestamp(a, b)\n    raise ArgumentError, _('Timestamps are only comparable to Timestamps, Integers, and Floats') unless b.is_a?(Time::Timestamp) || b.is_a?(Integer) || b.is_a?(Float)\n\n    a <=> b\n  end\n\n  def cmp_Version(a, b)\n    raise ArgumentError, _('Versions not comparable to non Versions') unless b.is_a?(SemanticPuppet::Version)\n\n    a <=> b\n  end\n\n  def cmp_Object(a, b)\n    raise ArgumentError, _('Only Strings, Numbers, Timespans, Timestamps, and Versions are comparable')\n  end\n\n  def equals_Object(a, b)\n    a == b\n  end\n\n  def equals_NilClass(a, b)\n    # :undef supported in case it is passed from a 3x data structure\n    b.nil? || b == :undef\n  end\n\n  def equals_Symbol(a, b)\n    # :undef supported in case it is passed from a 3x data structure\n    a == b || a == :undef && b.nil?\n  end\n\n  def include_Object(a, b, scope)\n    false","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/compare_operator.rb#L105-L141","documentation":"Error \"Only Strings, Numbers, Timespans, Timestamps, and Versions are comparable\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/compare_operator.rb:123 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"}