You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ed08a8c
Browse filesBrowse the repository at this point in the historyBrowse files
Complete list literal elements from the list's element type (#9263)
Why:
Completion inside list{…} lost the element type: an annotation
list<kind> became the context path Type[list], extract_type had no
case for list<'a>, and the [::] chain of a literal was walked as
constructor payloads. The analysis now has a list type, context path
and nested path next to the array ones; a [::] head is an element,
its tail the rest of the list, and the [] at its end, which holds
the cursor in list{} and list{a, }, a new element.
Example:
type kind = First | Second
let ys: list<kind> = list{First, Se}
Before (completable):
Cexpression Type[list]=Se->variantPayload::::($1), variantPayload::::($0)
After (completable):
Cexpression list<Type[kind]>=Se->list
Before (completions): module Set
After (completions): Second, module Set
Review: Does `list{...xs, }` complete an element now? No: a trailing
spread is the tail of the [::] chain, so the parser yields plain `xs`
and no element position is left, as #9212 notes.
Fixes#9212
Claude-Session: https://claude.ai/code/session_01Kbf3gJuq6rWZULJVY3ATmY
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments