Apply @stable to blocks, modules, and submodules
mainThe @stable macro can be applied to large scopes. It will recursively apply to:
- Code inside
begin...endblocks moduledefinitions- Included files via
include() - Nested submodules
All methods defined within these scopes will be wrapped with the type stability check.
@stable begin
f() = rand(Bool) ? 0 : 1.0
module A
g(; a, b) = a + b
include("myfile.jl")
module B
using DispatchDoctor: @unstable
@unstable h() = rand(Bool) ? 0 : 1.0
end
end
end