Skip to content

fix: dispatch <> overload on blessed objects instead of warning#502

Merged
fglock merged 2 commits intomasterfrom
fix/overload-diamond-operator
Apr 13, 2026
Merged

fix: dispatch <> overload on blessed objects instead of warning#502
fglock merged 2 commits intomasterfrom
fix/overload-diamond-operator

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Apr 13, 2026

Summary

  • Fix <> overload dispatch on blessed objects in both JVM and bytecode interpreter backends
  • When <$obj> is used on a blessed object with use overload '<>' => sub { ... }, PerlOnJava now correctly invokes the overloaded method instead of warning about an "unopened filehandle"
  • Readline.readline() now checks for (<> overload before falling through to the unopened filehandle warning
  • Bytecode interpreter backend (OpcodeHandlerExtended.executeReadline) now routes blessed objects to Readline.readline() instead of DiamondIO.readline()

This unblocks Iterator::Simple which now passes 67/67 tests (previously 65/67 with 2 <> overload failures).

Test plan

  • make passes (all unit tests)
  • Manual test: <$obj> with overloaded <> works in both JVM and interpreter backends
  • Iterator::Simple: all 11 test files, 67/67 tests pass

Generated with Devin

fglock and others added 2 commits April 13, 2026 14:50
When a blessed object with `use overload '<>' => sub { ... }` was used
in `<$obj>`, PerlOnJava treated it as readline on an unopened filehandle
instead of invoking the overloaded method.

Fix adds overload check in Readline.readline() before the unopened
filehandle warning, and routes blessed objects through Readline in the
bytecode interpreter backend.

This fixes Iterator::Simple test failures (67/67 tests now pass).

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fglock fglock merged commit 49baece into master Apr 13, 2026
2 checks passed
@fglock fglock deleted the fix/overload-diamond-operator branch April 13, 2026 13:01
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.

1 participant