{"record":{"id":"ce871b3ac42b6754","repo":"puppetlabs/puppet","slug":"can-only-append-binary-to-a-binary","errorCode":null,"errorMessage":"Can only append Binary to a Binary","messagePattern":"Can only append Binary to a Binary","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/evaluator_impl.rb","lineNumber":1243,"sourceCode":"            # Hash[[[a,1], [b,2]]] => {a => 1, b => 2}\n            # Use type calculator to determine if array is Array[Array[?]], and if so use second form\n            # of call\n            t = @@type_calculator.infer(y)\n            if t.element_type.is_a? Types::PArrayType\n              y.to_h\n            else\n              Hash[*y]\n            end\n          else\n            raise ArgumentError, _('Can only append Array or Hash to a Hash')\n          end\n      x.merge y # new hash with overwrite\n    when URI\n      raise ArgumentError, _('An URI can only be merged with an URI or String') unless y.is_a?(String) || y.is_a?(URI)\n\n      x + y\n    when Types::PBinaryType::Binary\n      raise ArgumentError, _('Can only append Binary to a Binary') unless y.is_a?(Types::PBinaryType::Binary)\n\n      Types::PBinaryType::Binary.from_binary_string(x.binary_buffer + y.binary_buffer)\n    else\n      concatenate([x], y)\n    end\n  end\n\n  # Produces the result x \\ y (set difference)\n  # When `x` is an Array, `y` is transformed to an array and then all matching elements removed from x.\n  # When `x` is a Hash, all contained keys are removed from x as listed in `y` if it is an Array, or all its keys if it is a Hash.\n  # The difference is returned. The given `x` and `y` are not modified by this operation.\n  # @raise [ArgumentError] when `x` is neither an Array nor a Hash\n  #\n  def delete(x, y)\n    result = x.dup\n    case x\n    when Array\n      y = case y","sourceCodeStart":1225,"sourceCodeEnd":1261,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/evaluator_impl.rb#L1225-L1261","documentation":"Error \"Can only append Binary to a Binary\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/evaluator_impl.rb:1243 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"}