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

error import-conflict

error Стандарт: [§2.2]

Два импорта вводят одно имя, и оно используется.

What it means#

Two imports introduce the same name into a module and the name is actually used (§2.2). Merely having both imports is fine; the error appears at the first use, because the compiler cannot choose between them.

Example#

oxl✓ проверяется в CI
use std.comptime { Span }
use std.obs { Span }

fn describe(s: Span) -> i32 pure => 1      // <- import-conflict
error
import-conflict

How to fix#

oxl✓ проверяется в CI
use std.comptime { Span }
use std.obs { Span as TraceSpan }

fn describe(s: Span) -> i32 pure => 1
fn trace(s: TraceSpan) -> i32 pure => 2

Rename one of the imports with as, or avoid importing one of them.

See also#

OxL 1.0.0-beta · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства