January 2020
Intermediate to advanced
532 pages
13h 31m
English
Julia comes with a handy macro in the Test package that can be used to check whether the return type of a function matches the inferred return type of the function. The inferred return type is simply the type that we see from the @code_warntype output before.
For example, we can check the notorious random_data function from the beginning of this section:

The macro reports an error whenever the actual returned type differs from the inferred return type. It could be a useful tool to validate the type instability problem as part of an automated test suite in the continuous integration pipeline.
The primary reason to ...
Read now
Unlock full access