Skip to content

Propagate warnings when calling .length on Vector#14744

Open
JaroslavTulach wants to merge 12 commits intodevelopfrom
wip/jtulach/WarningVectorLength11570
Open

Propagate warnings when calling .length on Vector#14744
JaroslavTulach wants to merge 12 commits intodevelopfrom
wip/jtulach/WarningVectorLength11570

Conversation

@JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Feb 10, 2026

Pull Request Description

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
  • Unit tests have been written where possible.
  • Engine benchmarks are not affected
  • Library benchmarks are not affected

@JaroslavTulach JaroslavTulach self-assigned this Feb 10, 2026
@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Feb 10, 2026
@JaroslavTulach JaroslavTulach requested a review from 4e6 as a code owner February 10, 2026 07:08
@JaroslavTulach JaroslavTulach added the CI: Clean build required CI runners will be cleaned before and after this PR is built. label Feb 10, 2026
@JaroslavTulach
Copy link
Member Author

There seems to be one test failure:

Use a slice of an array as vectors 114✅ 1❌
❌ Warnings and each
Expected False to be True (at /runner/_work/enso/enso/test/Base_Tests/src/Data/Vector_Spec.enso:1053:17-36).

Failure in JVM tests seems to be caused by outdated caches - e.g. not clean build

@JaroslavTulach
Copy link
Member Author

Use a slice of an array as vectors 114✅ 1❌
❌ Warnings and each
Expected False to be True (at /runner/_work/enso/enso/test/Base_Tests/src/Data/Vector_Spec.enso:1053:17-36).

  • I had to disable the check in 9383295
  • the Array elements are unlikely to have warning attached
    • the warning is assigned to the whole Array
    • but elements are without warnings
  • not sure why it worked before...

@JaroslavTulach
Copy link
Member Author

  • another failure related to each
  • VectorTest.insertSelfWithWarningViaForEach

@JaroslavTulach
Copy link
Member Author

Use a slice of an array as vectors 114✅ 1❌
❌ Warnings and each
Expected False to be True (at /runner/_work/enso/enso/test/Base_Tests/src/Data/Vector_Spec.enso:1053:17-36).

* I had to disable the check in [9383295](https://github.com/enso-org/enso/commit/93832952b6cc260838bf67ee5e0c22b4b9cdefb1)

* the `Array` elements are unlikely to have warning attached
  
  * the warning is assigned to the whole `Array`
  * but elements are without warnings

* not sure why it worked before...
  • there is still a failing test VectorTest.insertSelfWithWarningViaForEach
  • the problem is Array_Like_Helpers.each implementation and its treatment of warnings
  • the implementation calls vector.length and then uses it to iterate over 0.up_to len
    • in the new version that strips the warnings
    • and then reattached them later to the whole result
    • making elements passed to each callback warning less
  • calling the old version of length (that doesn't touch warnings) in Array_Like_Helpers.each seems to "fix" the problem

@JaroslavTulach
Copy link
Member Author

The problem with currently failing VectorTest is that InsertBuiltinVectorNode now produces WithWarnings[Vector.Generic] because length is associated with a warning!

obrazek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: No changelog needed Do not require a changelog entry for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vector.length doesn't propagate vector Warning with the length value

3 participants