Skip to content

Conversation

@jbdoderlein
Copy link
Contributor

@jbdoderlein jbdoderlein commented Jan 8, 2026

This change is linked to this issue
The documentation change is defined in this PR

This change allow the slicing to be out of bound and work with negative index.

With L = [0,1,2,3,4,5,6,7,8,9]; :

This PR Rascal v0.41.3
L[..-11] [] [1]
L[10..-5] [9,8,7,6] Interpreter Failure
L[-11..] [0,1,2,3,4,5,6,7,8,9] Interpreter Failure

Fixes #2370

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46%. Comparing base (3cc9359) to head (f6eec62).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2588   +/-   ##
=======================================
  Coverage       46%     46%           
+ Complexity    6628    6624    -4     
=======================================
  Files          793     793           
  Lines        65586   65590    +4     
  Branches      9823    9824    +1     
=======================================
+ Hits         30477   30487   +10     
+ Misses       32753   32750    -3     
+ Partials      2356    2353    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@PaulKlint PaulKlint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this refinement looks good. Thanks for fixing this and also for including test cases.

@DavyLandman DavyLandman merged commit 457885e into usethesource:main Jan 8, 2026
7 checks passed
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.

List slicing with negative end index behaves unexpectedly

3 participants