Skip to content

v0.12.0

Latest
Compare
Choose a tag to compare
@Qqwy Qqwy released this 06 Jun 20:20

Additions:

  • The default options used are now fetched from the application configuration. This means that you can configure a default for your app as well as for each of your dependencies(!) by adding config :app_name, :type_check [...] to your configuration file(s). (c.f. #61)
  • TypeCheck.External module, with functions to work with typespecs in modules outside of your control. Thank you very much, @orsinium! (c.f. #113)
    • fetch_spec to build a TypeCheck type from any function that has a @spec.
    • fetch_type to build a TypeCheck type from any @type.
    • enforce_spec! to wrap a call to any function that has a @spec with a runtime type-check on the input parameters and return value.
    • apply and apply! to wrap a call to any function with the function spec type that you give it.
  • TypeCheck.Defstruct.defstruct!, a way to combine defstruct, @enforce_keys and the creation of the struct's type, reducing boilerplate and the possibility of mistakes. (c.f. #118 )

Fixes:

  • Long-standing issue where Dialyzer would sometimes complain in apps using TypeCheck is resolved. (c.f. #95)
  • Creation of the new maybe_nonempty_list type will no longer get stuck in an infinite loop on creation. (c.f. #120)