Module Frontend.SignatureMismatch

type type_mismatch = private
  1. | DataOnlyError
  2. | TypeMismatch of Middle.UnsizedType.t * Middle.UnsizedType.t * details Core.option
and function_mismatch = private
  1. | ArgError of Core.int * type_mismatch
  2. | ArgNumMismatch of Core.int * Core.int
type ('unique, 'error) generic_match_result =
  1. | UniqueMatch of 'unique
  2. | AmbiguousMatch of (Middle.UnsizedType.returntype * Middle.UnsizedType.argumentlist * Middle.Location_span.t Core.option) Core.list
  3. | SignatureErrors of 'error

The match result for general (non-variadic) functions

val unique_minimum_promotion : ('a * Promotion.t Core.list) Core.list -> ('a * Promotion.t Core.list, 'a Core.list Core.option) Core.result

Searches for a function of the given name which can support the required argument types. Requires a unique minimum option under type promotion

val matching_stanlib_function : Core.string -> Middle.UnsizedType.argumentlist -> match_result

Same as matching_function but requires specifically that the function be from StanMath (uses Environment.stan_math_environment)

Check variadic function arguments. If a match is found, returns Ok of the function type and a list of promotions (see promote) If none is found, returns Error of the list of args and a function_mismatch.

val data_only_msg : Core.unit Fmt.t
val expected_style : 'a Fmt.t -> 'a Fmt.t

Add the formatting style for an expected value

val actual_style : 'a Fmt.t -> 'a Fmt.t

Add the formatting style for an incorrect actual value

val arguments : Core.int Fmt.t

Formatter for "arguments" with correct pluralization

val quoted : Core.string Fmt.t

Formatter for quoting a string

val pp_mismatch_details : skipped:Core.string Core.list -> Core.Format.formatter -> details -> Core.unit
val pp_signature_mismatch : Core.Format.formatter -> (Core.string * Middle.UnsizedType.t Core.list * (signature_error Core.list * Core.bool)) -> Core.unit
val list_valid_assignmentoperator_rhs : Middle.UnsizedType.t -> Middle.Operator.t -> Middle.UnsizedType.t Core.list
val compare_errors : function_mismatch -> function_mismatch -> Core.int
val compare_match_results : match_result -> match_result -> Core.int