OxL Reference

error private-in-public

error Standard: [§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✓ checked in CI
data Internal { id: u64 }

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

How to fix#

oxl✓ checked in 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 · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides