Semantic Diff

#9199 Complete array elements next to a spread from the element type

1 commit

ac7357822edb14ab7f695dcacff864e38205512e..pr-9199

1ad4acc8d · cknitt + Claude · Nov 03, 2026, 18:24 UTC

Complete array elements next to a spread from the element type

Why

Since #8905 an array literal with a spread is a Pexp_spread node, and expression completion had no case for it, so an element position next to a spread got no items and a partly typed element fell back to untyped completion.

modifiedCompletion array literal with a spread

type kind = First | Secondlet base: array<kind> = [First]let ys: array<kind> = [...base, ]
text
Before
After
no completion items at the cursor after the comma Completable: Cexpression array<Type[kind]>->arrayFirst, Second

Review

  • Why do list literals with a spread still get untyped completion? Completion extracts no element type for a list, so a list literal without a spread gets no typed completion either; the list case stays as before.