error visibility
What it means#
An item without a modifier is visible only inside its module, pub makes it visible inside the package, and pub(api) makes it visible to every package that depends on this one (§2.3). The same rules apply to data fields and to literals: a type with an invisible field cannot be built with a literal outside its module.
Example#
// src/billing/billing.oxl
fn secretRate() -> f64 { 0.2 }
// src/orders/orders.oxl
use self.billing { secretRate } // <- visibility
fn main() {}How to fix#
// src/billing/billing.oxl
pub fn secretRate() -> f64 { 0.2 }
// src/orders/orders.oxl
use self.billing { secretRate }
fn main() {}Add pub (or pub(api) for other packages) if the item is meant to be shared, or call a public function of the module instead.