Add snapshot cases for finding base slices on the type-slicing path - #290
Open
AltangerelG wants to merge 1 commit into
Open
AltangerelG wants to merge 1 commit into
AltangerelG wants to merge 1 commit into
Conversation
grahamegrieve
left a comment
Collaborator
There was a problem hiding this comment.
please update so that not every line of the manifest is changed
processPathWithSlicedBaseWhereDiffsConstrainTypes passes an index to findBaseSlices, which wants the slicer's own index: it skips the slicer's children and then collects the named slices that follow. empty-base-slices covers a base slicer with no named slice rows at all. sliced-base-with-children covers a base that declares a named slice and also constrains a child of the unsliced element, so the child rows sit between the slicing entry and the slice. Both fail on org.hl7.fhir.core master with "Index -1 out of bounds for length 0", in r5 and in r6, and pass with hapifhir/org.hl7.fhir.core#2662. For hapifhir/org.hl7.fhir.core#2585. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AltangerelG
force-pushed
the
test-cases/base-slices-index
branch
from
September 28, 2026 17:38
8cffe65 to
b999dd3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #288, one case per fix as @grahamegrieve asked.
Covers hapifhir/org.hl7.fhir.core#2585,
fixed by PR #2662.
Two cases, because the review turned up that the guard I first proposed was treating a
symptom:
empty-base-slices— the base slicesObservation.value[x]by type but declares nonamed slice. Nothing is found, and the base cursor has to fall back to the slicer's own
scope.
sliced-base-with-children— the base declares a named slice and constrains achild of the unsliced element, so the child rows sit between the slicing entry and the
slice. This is the one that shows the real defect:
findBaseSliceswas being given theslicer's last child instead of the slicer, so the named slice was never found.
Both fail on core master with
in r5 and in r6, and both pass with #2662. Expected files were generated by the fixed code
and then checked against master.