weird errors - #3755
Open
bobzhang wants to merge 1 commit into
Open
Conversation
1. from_array is an alias which is not imported
2. from_iter also has a weird warning message
git/core$moon check
Error: [4021]
╭─[ /Users/hongbozhang/git/core/sorted_map/map_test.mbt:161:13 ]
│
161 │ let map = from_array([(3, "c"), (2, "b"), (1, "a")])
│ ─────┬────
│ ╰────── The value identifier from_array is unbound.
─────╯
Warning: [0020]
╭─[ /Users/hongbozhang/git/core/sorted_map/map_test.mbt:179:5 ]
│
179 │ from_iter([(1, 1), (2, 2), (3, 3)].iter()),
│ ────┬────
│ ╰────── Warning (deprecated): Use SortedMap::from_iter instead.
─────╯
Warning: [0025]
╭─[ /Users/hongbozhang/git/core/sorted_map/map_test.mbt:179:5 ]
│
179 │ from_iter([(1, 1), (2, 2), (3, 3)].iter()),
│ ────┬────
│ ╰────── Warning (test_unqualified_package): `from_iterator` is implicitly imported in test. Use `@sorted_map.from_iterator` instead.
─────╯
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts sorted_map tests to call from_array / from_iter without the @sorted_map. qualifier, seemingly intended to address reported import/deprecation warnings.
Changes:
- Replaced
@sorted_map.from_array(...)withfrom_array(...)initer_collecttest. - Replaced
@sorted_map.from_iter(...)withfrom_iter(...)infrom_iter multiple elements itertest.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ///| | ||
| test "iter_collect" { | ||
| let map = @sorted_map.from_array([(3, "c"), (2, "b"), (1, "a")]) | ||
| let map = from_array([(3, "c"), (2, "b"), (1, "a")]) |
| test "from_iter multiple elements iter" { | ||
| debug_inspect( | ||
| @sorted_map.from_iter([(1, 1), (2, 2), (3, 3)].iter()), | ||
| from_iter([(1, 1), (2, 2), (3, 3)].iter()), |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
git/core$moon check
Error: [4021]
╭─[ /Users/hongbozhang/git/core/sorted_map/map_test.mbt:161:13 ]
│
161 │ let map = from_array([(3, "c"), (2, "b"), (1, "a")])
│ ─────┬────
│ ╰────── The value identifier from_array is unbound.
─────╯
Warning: [0020]
╭─[ /Users/hongbozhang/git/core/sorted_map/map_test.mbt:179:5 ]
│
179 │ from_iter([(1, 1), (2, 2), (3, 3)].iter()),
│ ────┬────
│ ╰────── Warning (deprecated): Use SortedMap::from_iter instead.
─────╯
Warning: [0025]
╭─[ /Users/hongbozhang/git/core/sorted_map/map_test.mbt:179:5 ]
│
179 │ from_iter([(1, 1), (2, 2), (3, 3)].iter()),
│ ────┬────
│ ╰────── Warning (test_unqualified_package):
from_iteratoris implicitly imported in test. Use@sorted_map.from_iteratorinstead.─────╯