fix: croak on trailing dash-option without CODE ref in import#90
Draft
Koan-Bot wants to merge 2 commits intocpan-authors:mainfrom
Draft
fix: croak on trailing dash-option without CODE ref in import#90Koan-Bot wants to merge 2 commits intocpan-authors:mainfrom
Koan-Bot wants to merge 2 commits intocpan-authors:mainfrom
Conversation
Previously, `use Overload::FileCheck '-e' => sub { 1 }, '-f'` would
silently discard the trailing `-f` option. Now it produces a clear
error message indicating the missing CODE ref.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The -B handler in _check_from_stat() was calling `-d $f_or_fh` to detect directories, which dispatched through the full mock system and triggered a second stat callback. Use _check_mode_type() on the already-fetched @stat array instead — same result, zero extra calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Detect and error on incomplete mock declarations in the
import()argument list.Why
use Overload::FileCheck '-e' => sub { 1 }, '-f'silently discarded the trailing-f— the user thinks they're mocking two operators but only one is active. This is a silent data loss bug.How
Added a post-loop check: if
$_next_checkis still set after processing all import args, croak with a clear message naming the orphaned option. Also optimized the-Bhandler in_check_from_stat()to check directory mode bits directly from the cached@statarray instead of dispatching through the full mock system (which triggered a redundant stat callback).Testing
t/import-trailing-option.tcovers both the single-option and trailing-option cases🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 49 insertions(+), 1 deletion(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline