Skip to content

Fix Carp croak locations for Moo eval wrappers - #1695

Merged
fglock merged 1 commit into
masterfrom
fix-1656-moo-croak-caller-location
Oct 8, 2026
Merged

fglock merged 1 commit into
masterfrom
fix-1656-moo-croak-caller-location

Conversation

@fglock

@fglock fglock commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Preserve the caller package captured at generated method entry while Carp walks caller frames, so Carp::croak reports Moo eval-generated call sites.
  • Add a focused Moo eval-wrapper regression test and changelog entry.

Fixes #1656.

Validation

  • prove src/test/resources/unit/carp_moo_eval_wrapper_location.t on system Perl: pass.
  • Focused regression on JVM and interpreter: pass.
  • Moo 2.005005 t/croak-locations.t: 29/29 assertions on JVM and interpreter.
  • nice -n 19 timeout 3600 make: pass.
  • nice -n 19 make check-links: pass.

Use the call-site package captured when generated methods are entered while
Carp walks caller frames. This lets Carp recognize the user package boundary
and report the location that invoked Moo-generated methods, without changing
ordinary caller frame numbering.

Add a Moo eval-wrapper regression test and a changelog entry.

Generated with [OpenAI Codex](https://openai.com/codex)

Co-Authored-By: OpenAI Codex <openai-codex@users.noreply.github.com>
@fglock
fglock marked this pull request as ready for review October 8, 2026 09:33
@fglock
fglock merged commit 43c1ca0 into master Oct 8, 2026
2 checks passed
@fglock
fglock deleted the fix-1656-moo-croak-caller-location branch October 8, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Runtime] Carp::croak reports eval wrapper location for Moo-generated methods

1 participant