MilesCranmer / DispatchDoctor.jl

The dispatch doctor prescribes type stability
Apache License 2.0
128 stars 6 forks source link

Move body to main function definition #17

Closed MilesCranmer closed 1 month ago

MilesCranmer commented 1 month ago

This is so you can use @code_warntype on a function definition.

Basically we now put the function body in both the "simulator" function as well as the original function. It uses the simulator to check the inferred type, then just assumes it will have the same thing and returns.

It also renames the generated function to be called "_simulator" rather than "_closure"

coveralls commented 1 month ago

Coverage Status

coverage: 98.469% (-0.02%) from 98.492% when pulling 3f8b9d58a52c404e085d227f6e56a06594e8cd3c on move-body into 532ebcb39d509d859e784357c1dc13ac95e7fe1a on main.