Skip to content

diff.carp: reference lifetime error in Map.put inside inner loop #2

@hellerve

Description

@hellerve

Running carp -x tests/diff.carp fails to compile:

The reference '(ref iold)' (depending on the variable '(Int.inc (if (/=__int iold 0) (do (Map.get__int_int (ref overlap) (ref (Int.dec iold)))) (do iold)))') isn't alive

The offending site is the Map.put _overlap &iold &(Int.inc ...) inside the inner for [i 0 (Array.length ol)] loop: the value expression (Int.inc (if (/= iold 0) (Map.get &overlap &(Int.dec iold)) iold)) depends on a reference whose source can be moved away by the Map.put's ownership.

CI has continue-on-error: true on the Run tests step, so this has been silently broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions