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

error private-in-public

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

Тип в сигнатуре менее видим, чем само объявление.

What it means#

A type used in the signature of a visible declaration MUST be at least as visible as the declaration itself (§2.3). Otherwise callers would have to name a type they cannot see.

Example#

oxl✓ проверяется в CI
data Internal { id: u64 }

pub fn make() -> Internal {      // <- private-in-public
  Internal{ id: 1 }
}
error
private-in-public

How to fix#

oxl✓ проверяется в CI
pub data Internal { id: u64 }

pub fn make() -> Internal {
  Internal{ id: 1 }
}

Make the type as visible as the function, or make the function less visible. For pub(api) functions every type in the signature must be pub(api) too.

See also#

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