OxL Справочник OxL
РусскийEnglish

error duplicate-decl

error Стандарт: [§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✓ проверяется в CI
data User { id: u64 }
data User { name: str }      // <- duplicate-decl

fn main() {}
error
duplicate-decl

How to fix#

oxl✓ проверяется в 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 · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства