Skip to content

Accumulate eagerly throws, ignoring side effects [low priority] #53458

@LilithHafner

Description

@LilithHafner

This code should print (1, 2) forever, and on Julia 1.0, it does. However, on 1.6 and 1.12 it throws.

accumulate([1,2,3]) do args...
    while true
        println(args)
    end
end

Just because we can infer that something does not return does not mean we may turn it into an error. Infinite loops are not UB in Julia.

Weakly related to #53438

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorfixed on masterregressionRegression in behavior compared to a previous version

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions