Skip to content

Fix bytecode compiler, list slices, Time::Local, and stat/filehandles#247

Merged
fglock merged 3 commits intomasterfrom
fix-bytecode-my-extraction
Feb 27, 2026
Merged

Fix bytecode compiler, list slices, Time::Local, and stat/filehandles#247
fglock merged 3 commits intomasterfrom
fix-bytecode-my-extraction

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Feb 27, 2026

Summary

  • Bytecode compiler my-extraction: Fix my variable extraction in short-circuit operators (&&, ||, //) and AUTOLOAD with forward declarations
  • Fix stat/filehandle support: Fix stat _ / lstat _ to use cached stat buffer, fix stat on filehandles and stat _ parsing
  • Fix signatures.t regression: Package inheritance in BytecodeCompiler.compile() was overwriting eval STRING package context (155 test regression from commit 0c15135e)
  • Fix signature error messages: Show "expected N" instead of "expected at most N" when min == max params
  • Fix list slice with range indices: (func())[0..2] now correctly expands the range instead of evaluating .. as flip-flop in scalar context
  • Fix localtime/gmtime for large epochs: Use getDouble() + Math.floor() instead of getInt() which truncated values > 2^31
  • Fix DayOfWeek: Convert Java's Mon=1..Sun=7 to Perl's Sun=0..Sat=6
  • Update Time::Local.pm from 1.30 to 1.35 (upstream CPAN)

Test plan

  • ./gradlew test — all 154 unit tests pass
  • signatures.t — regression fixed
  • Time::Local Local.t — all 9 subtests pass (was 6/9)
  • List slice: (func())[0..2], ("a","b","c")[0..2], (func())[1,3] all work correctly

Generated with Devin

fglock and others added 3 commits February 27, 2026 09:46
The handleArrowArrayDeref method had an overly restrictive check that
only treated a single range index (0..2) as a slice when the left side
was a "true array literal" with multiple literal elements. This caused
(func())[0..2] and similar expressions to evaluate the range in scalar
context (flip-flop) instead of list context (range expansion).

Simplified the condition: any single range operator in the index now
always uses the slice path, regardless of what the left side is.

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

Co-Authored-By: Devin <noreply@cognition.ai>
- Time.java: Use getDouble()+Math.floor() instead of getInt() for epoch
  values in localtime/gmtime, fixing truncation for values > 2^31
- Time.java: Fix DayOfWeek conversion (Java Mon=1..Sun=7 to Perl Sun=0..Sat=6)
- Update Time::Local.pm from 1.30 to 1.35 (upstream CPAN)
- Add Time-Local test import to config.yaml

All 9 Time::Local test subtests now pass.

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

Co-Authored-By: Devin <noreply@cognition.ai>
Was using Java DateTimeFormatter.RFC_1123_DATE_TIME which produces
Fri, 27 Feb 2026 10:00:43 +0100. Now produces the correct Perl
asctime format: Fri Feb 27 10:00:43 2026.

op/time.t: 21 to 71 of 72 passing (only ENV TZ test remains).

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

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock merged commit 7f52739 into master Feb 27, 2026
2 checks passed
@fglock fglock deleted the fix-bytecode-my-extraction branch February 27, 2026 09:25
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