Skip to content

test_edge_closures: LLVM IR @perry_global_* name collision (duplicate global at numeric suffix __22) #456

Description

@proggeramlug

Summary

test_edge_closures.ts fails to compile with:

error: redefinition of global '@perry_global_test_edge_closures_ts__22'
✗ ENTRY MODULE FAILED TO COMPILE — REFUSING TO LINK

Pre-existing — reproduces on v0.5.502 / v0.5.503 / v0.5.510 unchanged. Surfaced during v0.5.510 release-CI gate audit; was previously not in test-parity/known_failures.json and started failing the parity gate when the empty {} known_failures + this test's drift collided on a recent commit.

Repro

./target/release/perry test-files/test_edge_closures.ts -o /tmp/test_edge_closures

Fails with the redefinition error.

Suspected root cause

The numeric suffix on @perry_global_<module>__<id> globals is allocated per-module. A closure-related lowering path in test_edge_closures.ts is emitting the same id twice — likely a next_global_id counter not being incremented on one of two emission sites. Worth grepping crates/perry-codegen/src/codegen.rs and crates/perry-codegen/src/expr.rs for perry_global_ emissions where the same id can be produced twice (e.g. one branch increments before emit, another increments after).

Workaround

Test is currently entered into test-parity/known_failures.json so CI passes. Underlying bug should be fixed in a follow-up.

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