{"record":{"id":"cf26cd82da2d0e2e","repo":"puppetlabs/puppet","slug":"puppet-pops-types-typemismatchdescriber-describ","errorCode":null,"errorMessage":"Puppet::Pops::Types::TypeMismatchDescriber.describe_signatures(instance.class.name, signatures, args_type)","messagePattern":"Puppet::Pops::Types::TypeMismatchDescriber\\.describe_signatures\\(instance\\.class\\.name, signatures, args_type\\)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/functions/dispatcher.rb","lineNumber":40,"sourceCode":"  end\n\n  def find_matching_dispatcher(args, &block)\n    @dispatchers.find { |d| d.type.callable_with?(args, block) }\n  end\n\n  # Dispatches the call to the first found signature (entry with matching type).\n  #\n  # @param instance [Puppet::Functions::Function] - the function to call\n  # @param calling_scope [T.B.D::Scope] - the scope of the caller\n  # @param args [Array<Object>] - the given arguments in the form of an Array\n  # @return [Object] - what the called function produced\n  #\n  # @api private\n  def dispatch(instance, calling_scope, args, &block)\n    dispatcher = find_matching_dispatcher(args, &block)\n    unless dispatcher\n      args_type = Puppet::Pops::Types::TypeCalculator.singleton.infer_set(block_given? ? args + [block] : args)\n      raise ArgumentError, Puppet::Pops::Types::TypeMismatchDescriber.describe_signatures(instance.class.name, signatures, args_type)\n    end\n    if dispatcher.argument_mismatch_handler?\n      msg = dispatcher.invoke(instance, calling_scope, args)\n      raise ArgumentError, \"'#{instance.class.name}' #{msg}\"\n    end\n\n    catch(:next) do\n      dispatcher.invoke(instance, calling_scope, args, &block)\n    end\n  end\n\n  # Adds a dispatch directly to the set of dispatchers.\n  # @api private\n  def add(a_dispatch)\n    @dispatchers << a_dispatch\n  end\n\n  # Produces a CallableType for a single signature, and a Variant[<callables>] otherwise","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/functions/dispatcher.rb#L22-L58","documentation":"Error \"Puppet::Pops::Types::TypeMismatchDescriber.describe_signatures(instance.class.name, signatures, args_type)\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/functions/dispatcher.rb:40 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"}