Faulty or missing type declarations, especially for struct fields, are a common performance pitfall in Julia. This package allows you to check that the structs you work with have concretely-typed fields.
You can install CheckConcreteStructs.jl from the GitHub URL:
using Pkg
Pkg.add(url="https://github.com/gdalle/CheckConcreteStructs.jl")The main exports of this package are:
- the function
all_concrete, which can be used on an existing type or module - the macro
@check_concrete, which can be used before astructdefinition
Please read their docstrings for examples.
ConcreteStructs.jl exports a macro @concrete which adds all the necessary type parameters to a struct definition. In other words:
- CheckConcreteStructs.jl tells you how to fix problems when they occur.
- ConcreteStructs.jl prevents them from occurring at all (in a slightly more opaque way).