E0715: Import spellings same file
| Code | Category | Stability |
|---|---|---|
E0715 | Intrinsic | Permanent |
Explanation
Two distinct logical import names reached the same physical file through non-symlink filesystem aliases, such as hard links or case variants on a case-insensitive filesystem. Giving one file multiple logical module identities within its applicable namespace would make declaration and provenance ownership ambiguous, so Rue reports the later import site. Repeating one logical spelling remains valid, and symlink routes canonicalize to one module.
Likely cause
The source tree contains hard-linked paths to one file, or two import strings differ only in spelling while the host filesystem treats them as the same file. Remove the alias and import the file consistently under one logical name in the applicable namespace.
Examples
Import hard-linked paths under different names
// --- main.rue
const first = @import("a.rue");
const second = @import("b.rue");
fn main() -> i32 { 0 }
// --- a.rue
pub fn value() -> i32 { 1 }
// --- b.rue
pub fn value() -> i32 { 1 }
Repeat one logical import spelling
// --- main.rue
const first = @import("helper.rue");
const second = @import("helper.rue");
fn main() -> i32 { first.value() + second.value() }
// --- helper.rue
pub fn value() -> i32 { 1 }