Function Documentation

Inline Stability Checks

# TypeStability.enable_inline_stability_checksFunction.

enable_inline_stability_checks(::Bool)

Sets whether to run inline stability checks from @stable_function.

If it is set to false (the default value), @stable_function does not perform any type stability checks.

The value is checked when @stable_function is evaluated, so this should useually be set at the begining of a package definition.

See inline_stability_checks_enabled.

source

# TypeStability.inline_stability_checks_enabledFunction.

inline_stability_checks_enabled()::Bool

Returns whether inline stability checks are enabled.

See enable_inline_stability_checks.

source

# TypeStability.@stable_functionMacro.

@stable_function arg_lists function_name
@stable_function arg_lists function_definition(s)
@stable_function arg_lists acceptable_instability function_name
@stable_function arg_lists acceptable_instability function_definitions(s)

Checks the type stability of the function under the given argument lists.

If the second value is a function definition, the function is defined before checking type stability.

source

External Stability Checks

# TypeStability.StabilityReportType.

StabilityReport()
StabilityReport(unstable_variables::Vector{Tuple{Symbol, Type}})

Holds information about the stability of a method.

If unstable_vars is present, set the fields. Otherwise, creates an empty set.

See is_stable

source

# TypeStability.is_stableFunction.

is_stable(report::StabilityReport)::Bool
is_stable(reports::AbstractArray{StabilityReport})::Bool
is_stable(reports::AbstractArray{Tuple{<:Any, StabilityReport}})::Bool

Check if the given StabilityReports don't have any unstable types.

source

# TypeStability.stability_warnFunction.

stability_warn(func_name, report::AbstractArray{Tuple{<:Any,StabilityReport}})

Displays warnings about the function if any of the reports are not stable

source

# TypeStability.check_functionFunction.

check_function(func, signatures, acceptable_instability=Dict())

Check that the function is stable under each of the given signatures.

Return an array of method signature-StabilityReport pairs from check_method.

source

# TypeStability.check_methodFunction.

check_method(func, signature, acceptable_instability=Dict())

Create a StabilityReport object describing the type stability of the method.is

Compute non-concrete types of variables and return value, returning them in a StabilityReport Object

acceptable_instability, if present, is a mapping of variables that are allowed be non-concrete types. get is called with the mapping, the variable's symbol and Bool to get the variable's allowed type. Additionally, the return value is checked using :return as the symbol.

source

Utiltities

# TypeStability.RegexDictType.

RegexDict(::Tuple{Union{Regex, String}, T}...)

Creates a dictionary that uses Regexes as keys and tests against those when looking up keys. Symbols can be used as lookup keys, by using their name. If multiple Regexes match a key, the value associated with any of them may be returned.

source