Skip to content

list comprehensions with conditionals are not supported #129

@Krastanov

Description

@Krastanov
julia> @resumable function f1()
           [i for i in 1:10 if i<5]
       end
ERROR: LoadError: Illegal expression in generator: i = 1:10 if i < 5
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] scope_generator(expr::Expr, scope::ResumableFunctions.ScopeTracker)
   @ ResumableFunctions ~/Documents/ScratchSpace/quantumjulia/ResumableFunctions.jl/src/utils.jl:345
 [3] scoping(expr::Expr, scope::ResumableFunctions.ScopeTracker)
   @ ResumableFunctions ~/Documents/ScratchSpace/quantumjulia/ResumableFunctions.jl/src/utils.jl:361
 [4] scoping(expr::Expr, scope::ResumableFunctions.ScopeTracker) (repeats 2 times)
   @ ResumableFunctions ~/Documents/ScratchSpace/quantumjulia/ResumableFunctions.jl/src/utils.jl:565
 [5] var"@resumable"(__source__::LineNumberNode, __module__::Module, ex::Vararg{Expr})
   @ ResumableFunctions ~/Documents/ScratchSpace/quantumjulia/ResumableFunctions.jl/src/macro.jl:100
in expression starting at REPL[26]:1

julia> @resumable function f2()
           [i for i in 1:10]
       end
f2 (generic function with 1 method)

julia> function f3()
           [i for i in 1:10 if i<5]
       end
f3 (generic function with 1 method)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions