{"record":{"id":"9267ed9976b25563","repo":"puppetlabs/puppet","slug":"versions-not-comparable-to-non-versions","errorCode":null,"errorMessage":"Versions not comparable to non Versions","messagePattern":"Versions not comparable to non Versions","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/compare_operator.rb","lineNumber":117,"sourceCode":"    else\n      raise ArgumentError, _(\"Symbol not comparable to non Symbol\")\n    end\n  end\n\n  def cmp_Timespan(a, b)\n    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)","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/compare_operator.rb#L99-L135","documentation":"CompareOperator#cmp_Version guard: a SemanticPuppet::Version was ordered against an operand that is not a Version.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/compare_operator.rb:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Parse the other operand into a semantic version (e.g. with semver() or new()) before comparing"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","contentChangedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}