-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[move-compiler] add support for public(package)
visibility.
#13408
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff! Thanks for working out the test generation too!
Requesting changes for:
- The implementation of
check_visibility_modifiers
and the missing sub/secondary labels - Fixing the friend list generation
- A test that runs the code. This might require some edition support in the transactional test framework. We could maybe make it an argument to
init
- A test that tests named packages, you will need to add move-cli tests for that
...nal-crates/move/move-compiler/tests/move_check/typing/module_public_package_featuregate.move
Outdated
Show resolved
Hide resolved
...l-crates/move/move-compiler/tests/move_2024/typing/module_call_visibility_mixed_invalid.move
Outdated
Show resolved
Hide resolved
external-crates/move/move-compiler/tests/move_2024/typing/module_call_visibility_friend.move
Outdated
Show resolved
Hide resolved
de1e5ff
to
edaaa8f
Compare
edaaa8f
to
86955ad
Compare
86955ad
to
e08ff7e
Compare
external-crates/move/move-compiler/tests/move_check/parser/function_visibility_empty.exp
Outdated
Show resolved
Hide resolved
88563a5
to
dc717ee
Compare
dc717ee
to
df7f9fc
Compare
This adds support for `public(package)` visibility, including feature gating it between Move 2024 edition. It also includes tests to ensure visibility and feature gate checking. Add new tests to the compiler, including expected results. [ ] protocol change [x] user-visible impact [ ] breaking change for a client SDKs [ ] breaking change for FNs (FN binary must upgrade) [ ] breaking change for validators or node operators (must upgrade binaries) [ ] breaking change for on-chain data layout [ ] necessitate either a data wipe or data migration
Update wording Co-authored-by: Tim Zakian <2895723+tzakian@users.noreply.github.com>
df7f9fc
to
817d15b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package tests look great! Thanks!
Though I'm a bit confused by the result of that one public package test :/
Otherwise, mostly just implementation nits :)
external-crates/move/testing-infra/transactional-test-runner/src/framework.rs
Show resolved
Hide resolved
external-crates/move/move-compiler/transactional-tests/tests/dependencies/public_package.move
Show resolved
Hide resolved
external-crates/move/move-compiler/transactional-tests/tests/dependencies/public_package.move
Outdated
Show resolved
Hide resolved
...e/move-compiler/transactional-tests/tests/dependencies/public_package_different_packages.exp
Show resolved
Hide resolved
.../move-compiler/transactional-tests/tests/dependencies/public_package_different_packages.move
Show resolved
Hide resolved
1aa5a1a
to
fc20243
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly certain the collect::<UniqueMap<_,_>>
added will crash the compiler, so let's add the test to be sure.
But as a style thing, I'd really rather not add the hidden unwrap, as I think it will just cause issues.
For the transactional test that feels unexpected, this is really more of an issue with how I setup package definitions, and I will fix it in another PR (so don't worry about it)
.../move-compiler/transactional-tests/tests/dependencies/public_package_different_packages.move
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late getting back to this!
Description
This adds support for
public(package)
visibility, including feature gating it between Move 2024 edition. It also includes tests to ensure visibility and feature gate checking.Test Plan
Add new tests to the compiler, including expected results.
Type of Change (Check all that apply)
Release notes
Adds initial
public(package)
support to Move 2024.alpha. Instead of explicitly listing friend modules, you can now make function definitions public across the entire package. They are publicly available for any modules in that package, but you still cannot call them outside of that package.