Skip to content

AST: Return analysis errors through DiagnosticManager - #418

Merged
KyrylR merged 1 commit into
BlockstreamResearch:masterfrom
LesterEvSe:feat/collect-multi-errors
Sep 20, 2026
Merged

KyrylR merged 1 commit into
BlockstreamResearch:masterfrom
LesterEvSe:feat/collect-multi-errors

Conversation

@LesterEvSe

@LesterEvSe LesterEvSe commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR prepares the AST phase for reporting multiple errors. Program::analyze now takes &mut DiagnosticManager and returns Option<Self> instead of Result<Self, Diagnostic>. Behaviour does not change: analysis still stops at the first error.

Next steps

Follow-up PRs will extend analysis from one error to many, one level at a time:

  1. Report every error inside an expression (tuple elements, call arguments, match arms), not only the first one. Report every error inside an expression #420
  2. Continue with the next item after an item fails. Keep analyzing items after a function body fails #424
  3. Continue with the next statement after a statement fails.

Each step reports only independent errors, so it does not need poisoning to prevent cascading errors. Poisoning will come later, for the cases where analysis would otherwise stop, such as a broken declared type.

@LesterEvSe LesterEvSe self-assigned this Sep 18, 2026
@LesterEvSe
LesterEvSe requested a review from delta1 as a code owner September 18, 2026 13:07
@LesterEvSe LesterEvSe added the enhancement New feature or request label Sep 18, 2026
Comment thread src/ast.rs Outdated
@LesterEvSe
LesterEvSe force-pushed the feat/collect-multi-errors branch 2 times, most recently from 5b8c09d to ffe3b65 Compare September 18, 2026 14:16
@LesterEvSe
LesterEvSe force-pushed the feat/collect-multi-errors branch from ffe3b65 to 1f279a4 Compare September 18, 2026 14:20

@KyrylR KyrylR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 1f279a4; successfully ran local tests

@KyrylR
KyrylR merged commit bb81a26 into BlockstreamResearch:master Sep 20, 2026
12 checks passed
@KyrylR KyrylR mentioned this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants