Description
Currently, when an unqualified import like import wibble.{wobble}
is shadowed by a top-level definition in the module (const wobble
, fn wobble(...)
) the warning generated on the import says it is unused:
Unused imported value
This imported value is never used.
Technically this is true, but a clearer warning would notify the developer that the imported value can never be used because it is shadowed by a top-level definition:
Unusable imported value
This imported value can never be used as it is shadowed by thewobble
function.
This is a clearer message as the developer may look at their source code and be confused to see wobble
is indeed used even though the compiler is warning them otherwise.
// The compiler will warn that `wobble` here is unused...
import wibble.{wobble}
fn something_else(...) {
// ...but a developer might be confused to see that wobble
// is used here.
let x = wobble(...)
//
...
}
// The actual wobble being used is this one
fn wobble(...) {
...
}