Skip to content

Fix indirect object syntax with variable class#345

Merged
fglock merged 1 commit into
masterfrom
fix/set-infinite-tests
Mar 20, 2026
Merged

Fix indirect object syntax with variable class#345
fglock merged 1 commit into
masterfrom
fix/set-infinite-tests

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Mar 20, 2026

Summary

Support indirect object syntax where the class name is stored in a variable:

  • new $type $arg is now correctly parsed as $type->new($arg)
  • new $type $a, $b is parsed as $type->new($a, $b)

This is valid Perl syntax commonly used by CPAN modules like Set::Infinite.

Changes

  • Added handling in SubroutineParser.java for indirect object syntax with variable class
  • The fix only applies when the subroutine does not exist as a function, preventing incorrect parsing of existing function calls

Test Plan

  • All unit tests pass
  • Set::Infinite tests now pass (446 tests across 11 test files)

Generated with Devin

Support indirect object syntax where the class is stored in a variable:
  new $type $arg  ->  $type->new($arg)

This is valid Perl syntax used by Set::Infinite and other CPAN modules.
The fix only applies when the subroutine doesn't exist as a function,
preventing incorrect parsing of existing function calls.

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 dbc2e9f into master Mar 20, 2026
2 checks passed
@fglock fglock deleted the fix/set-infinite-tests branch March 20, 2026 18:44
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