Skip to content

Potential lowering bug on 1.12 #55888

@Drvi

Description

@Drvi

As spotted by @NHDaly on RelationalAI slack; I'm making this issue so it doesn't get lost.

function assign_node_ids(node, starting_id::Int)

    ii = starting_id

    function _traverse::BackIRType)
        new_φ = _copy_and_assign_id(φ, ii)
        if new_φ !== φ
            ii += 1
        end
        return new_φ
    end

    _traverse(n) = n

    return (bottomup(_traverse)(node), ii)
end

Which gave

        UndefVarError: `ii` not defined in local scope
        Suggestion: check for an assignment to a local variable that shadows a global of the same name.

pointing to the first line in the closure:

        new_φ = _copy_and_assign_id(φ, ii)

CC: @gbaraldi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions