OxL Reference

error duplicate-decl

error Standard: [§2.1]

What it means#

All files of a module share one namespace (§2.1), so two top-level declarations with the same name, in the same file or in different files of the module, conflict. The same applies to two members with one name in a single data, enum or impl. (let bindings are different: they may shadow, §4.1.)

Example#

oxl✓ checked in CI
data User { id: u64 }
data User { name: str }      // <- duplicate-decl

fn main() {}
error
duplicate-decl

How to fix#

oxl✓ checked in CI
data User { id: u64 }
data UserProfile { name: str }

fn main() {}

Rename one declaration or merge them. Declarations in different modules never conflict.

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides