-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made use * of non
pub
items not affect the compilation.
Closes #6889. Done by using unique found item if visible, and additionally if not found in base, looking in prelude.
- Loading branch information
Showing
2 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
pub mod a { | ||
mod a { | ||
pub const NON_SHADOWED: felt252 = 'non_shadowed'; | ||
pub const SHADOWED: felt252 = 'original_shadowed'; | ||
pub const PUBLISHED_ONCE: felt252 = 'published_once'; | ||
} | ||
|
||
mod b { | ||
const PUBLISHED_ONCE: felt252 = 'ignored'; | ||
#[allow(unused_imports)] | ||
use core::array::Span; | ||
} | ||
|
||
pub const SHADOWED: felt252 = 'new_shadowed'; | ||
use a::*; | ||
use b::*; | ||
|
||
#[test] | ||
fn test_use_star_shadowing() { | ||
assert_eq!(NON_SHADOWED, 'non_shadowed'); | ||
assert_eq!(SHADOWED, 'new_shadowed'); | ||
} | ||
|
||
#[test] | ||
fn test_use_star_non_pub() { | ||
assert_eq!(PUBLISHED_ONCE, 'published_once'); | ||
let _x: Span<felt252> = [].span(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters