Lyricdev
GitHub

LYR-PAR0053

a visibility word where none or another belongs

error ยท spec 04-modules

A declaration or member has two visibility words (pub private), an enum variant has one, or an import has one other than pub.

Explanation

A declaration takes one of pub, internal, private, or none. A variant is as visible as its enum, so the word belongs before enum. An import is its module's own; pub import passes it on, and no other word stands there.

Keep one word, in its place.

Wrong

pub private fn f(): int {
    return 1;
}

fn main(): void {
}
private fn f(): int {
    return 1;
}

fn main(): void {
    let _ = f();
}