Skip to content

@one_by_one doesn't work inside a if-blockΒ #118

@Moelf

Description

@Moelf
julia> @tasks for i in 1:10
           if true
               @one_by_one begin
                   println(i)
                   sleep(0.1)
               end
           end
       end
ERROR: LoadError: The @one_by_one macro may only be used inside of a @tasks block.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] var"@one_by_one"(__source__::LineNumberNode, __module__::Module, args::Vararg{Any})
   @ OhMyThreads ~/.julia/packages/OhMyThreads/20X0i/src/macros.jl:207
in expression starting at REPL[2]:3

Currently the @tasks macro needs to see @one_by_one directly, but logically speaking this is not necessary

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions