"Use of undeclared name" should point to what is undeclared if it is a path
With this code
mod mod1 {
mod mod2 {
fn yes() -> bool { true }
}
}
fn top() -> bool {
mod1::yes()
}
we get the error
error: Use of undeclared name mod1::yes
┌─ src/main.spade:8:5
│
8 │ mod1::yes()
│ ^^^^^^^^^ Undeclared name
It would be nice if the error instead was
error: Use of undeclared name yes
┌─ src/main.spade:8:5
│
8 │ mod1::yes()
│ ^^^ Undeclared name
since mod1 is declared.
This is clearer if using dependencies because then it's harder to go check manually what is defined where.