noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
884 stars 195 forks source link

Typo in path with type alias panics #5546

Closed michaeljklein closed 3 months ago

michaeljklein commented 3 months ago

Aim

Attempted to compile a program with a typo in the path to a type alias:

type Foo = u8;

fn main() {
    // These also panic, where Bar is another type alias
    // let _: Foo::Foo = 0;
    // let _: Foo::Bar = 0;

    // 'std' or another path member also panics, even an undefined one, e.g. `foo`
    let _: Foo::std = 0;
}

Expected Behavior

Expected a user error to be returned

Bug

nargo panics without location information

To Reproduce

1. 2. 3. 4.

Project Impact

Nice-to-have

Impact Context

No response

Workaround

Yes

Workaround Description

Manually locate the source of the error

Additional Context

No response

Installation Method

Binary (noirup default)

Nargo Version

nargo version = 0.31.0 noirc version = 0.31.0+45e82a672b9ba7f7326e8d9f8800e2489013e2e8 (git version hash: 45e82a672b9ba7f7326e8d9f8800e2489013e2e8, is dirty: false)

NoirJS Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

michaeljklein commented 3 months ago

Redundant with https://github.com/noir-lang/noir/issues/4469