Skip to content

Keep analyzing UseDecl blocks after broken UseItems - #451

Open
LesterEvSe wants to merge 3 commits into
BlockstreamResearch:masterfrom
LesterEvSe:feat/use-poisoning
Open

LesterEvSe wants to merge 3 commits into
BlockstreamResearch:masterfrom
LesterEvSe:feat/use-poisoning

Conversation

@LesterEvSe

Copy link
Copy Markdown
Collaborator

Description

This PR adds poisoning for use declaration blocks. So if we have an incorrect name in the items block, we raise only one error for it. After this PR, if the UseDecl is correct, we analyze it even if its UseItems are broken or the entire UseDecl is private.

For this code:

mod math {
    pub fn double(a: u32) -> u32 { a }
    fn secret() -> u32 { 7 }
}

use crate::math::{double, triple, secret};

fn helper() -> u32 {
    let x: u32 = triple(1);
    unknown
}

fn main() {
    let a: u32 = double(1);
    let c: u32 = secret();
    let d: bool = a;
}

On master there is only one error:

Item `triple` could not be found

With this PR:

Item `triple` could not be found
Item `secret` is private
Variable `unknown` is not defined
Expected expression of type `bool`, found type `u32`

Checklist

  • New or changed language features are used in fixtures/kitchen_sink.simf (see its header).

@LesterEvSe
LesterEvSe requested a review from KyrylR October 23, 2026 11:25
@LesterEvSe LesterEvSe self-assigned this Oct 23, 2026
@LesterEvSe
LesterEvSe requested a review from delta1 as a code owner October 23, 2026 11:25
@LesterEvSe LesterEvSe mentioned this pull request Oct 23, 2026
1 task done

This branch has not been deployed

No deployments
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.

1 participant