Skip to content

Commit

Permalink
tests/invalid_code: add test for pub(pkg)
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Jul 4, 2024
1 parent 1e00c2b commit b9263e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/invalid_code/access_modifer.bs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
mod my_mod {
const x = 1;
pub(pkg) const rs = 2014;
pub const v = 4;
}

fn main() {
const my_x = my_mod::x; // error
const my_rs = my_mod::rs; // ok
const my_v = my_mod::v; // ok
}
2 changes: 1 addition & 1 deletion tests/invalid_code/access_modifer.out
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tests/invalid_code/access_modifer.bs:7:26: error: cannot access private constant `x`
tests/invalid_code/access_modifer.bs:8:26: error: cannot access private constant `x`

0 comments on commit b9263e2

Please sign in to comment.