Skip to content

feat: infer type of assignments from a type-asserted RHS#145

Merged
pfitzseb merged 1 commit into
mainfrom
sp/completion-type-assertion-narrowing
Jul 15, 2026
Merged

feat: infer type of assignments from a type-asserted RHS#145
pfitzseb merged 1 commit into
mainfrom
sp/completion-type-assertion-narrowing

Conversation

@pfitzseb

Copy link
Copy Markdown
Member

Field completion now narrows through a local type assertion: an assignment whose right-hand side is a :: type assertion (y = x::T or x = x::T) gives the assigned binding the asserted type, the same way a ::T parameter declaration does.

Because each assignment is its own binding, narrowing is scoped correctly by StaticLint's existing resolution, including per-branch.

Fixes julia-vscode/LanguageServer.jl#1353, kinda.

Field completion now narrows through a local type assertion: an
assignment whose right-hand side is a `::` type assertion (`y = x::T`
or `x = x::T`) gives the assigned binding the asserted type, the same
way a `::T` parameter declaration does.

Because each assignment is its own binding, narrowing is scoped
correctly by StaticLint's existing resolution, including per-branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pfitzseb pfitzseb merged commit e6ba3e8 into main Jul 15, 2026
18 of 19 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.

feat: autocomplete using inferred type instead of declared type in a function

1 participant