Skip to content

Fix scalar split and zero-average behavior - #1395

Merged
asika32764 merged 2 commits into
masterfrom
copilot/fix-scalar-type-bugs
Nov 8, 2026
Merged

asika32764 merged 2 commits into
masterfrom
copilot/fix-scalar-type-bugs

Conversation

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

StringObject::split() could throw a TypeError, and ArrayObject::avg() returned null for non-empty arrays whose sum was zero.

  • String splitting: Route split() through StringObject::explode().
  • Array averages: Return null only for empty arrays; zero-sum arrays now return their calculated average.
str('a,b')->split(',')->dump(); // ['a', 'b']
arr([1, -1])->avg();            // 0

Copilot AI linked an issue Nov 8, 2026 that may be closed by this pull request
Co-authored-by: asika32764 <1639206+asika32764@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix type bugs in Scalars for StringObject and ArrayObject Fix scalar split and zero-average behavior Nov 8, 2026
Copilot AI requested a review from asika32764 November 8, 2026 04:35
@asika32764
asika32764 marked this pull request as ready for review November 8, 2026 05:36
@asika32764
asika32764 merged commit d53fd3a into master Nov 8, 2026
0 of 14 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.

[Scalars] type bugs

2 participants