apple / apple/pkl

`String.split` omits final empty string(s) for trailing pattern

Open
#1,178 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
11.5k
Forks
402
Avg merge
1d 15h
Merged PRs (30d)
20

Description

Reproduced in 0.29.0.

Reproducer:

```pkl
// Expected: List("", "c", "", "")
// Got: List("", "c")
"abcababab".split("ab")
// Works as expected: List("", "1")
".1".split(".")
// Expected: List("", "1", "")
// Got: List("", "1")
".1.".split(".")
```

Empty strings will be omitted from the end no matter how many times you repeat the pattern.

Contributor guide

Open the contributing guide

Research direction

Start by running the Pkl reproducer from the issue and locating the String.split implementation and its existing tests. Done means trailing empty strings are preserved for repeated trailing patterns while the shown non-trailing cases continue to produce their expected lists.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.