{"record":{"id":"350fc83bb3a07521","repo":"puppetlabs/puppet","slug":"a-string-is-not-comparable-to-a-non-string","errorCode":null,"errorMessage":"A String is not comparable to a non String","messagePattern":"A String is not comparable to a non String","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/compare_operator.rb","lineNumber":53,"sourceCode":"    @@compare_visitor.visit_this_1(self, a, b)\n  end\n\n  # Performs a match of a and b, and returns true if b matches a\n  def match(a, b, scope = nil)\n    @@match_visitor.visit_this_2(self, b, a, scope)\n  end\n\n  # Answers is b included in a\n  def include?(a, b, scope)\n    @@include_visitor.visit_this_2(self, a, b, scope)\n  end\n\n  protected\n\n  def cmp_String(a, b)\n    return a.casecmp(b) if b.is_a?(String)\n\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","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/compare_operator.rb#L35-L71","documentation":"Error \"A String is not comparable to a non String\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/compare_operator.rb:53 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"}