-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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-v2] add parser code for lambda types #14792
Conversation
⏱️ 2h 37m total CI duration on this PR
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 09-27-extend_parser_for_lambda_types #14792 +/- ##
=======================================================================
Coverage ? 59.9%
=======================================================================
Files ? 852
Lines ? 207826
Branches ? 0
=======================================================================
Hits ? 124528
Misses ? 83298
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7f59256
to
ae73f37
Compare
dbd482d
to
270214e
Compare
ae73f37
to
243ea0f
Compare
270214e
to
afbad9b
Compare
243ea0f
to
f3d30eb
Compare
a40a3c9
to
71ef91f
Compare
f3d30eb
to
0cc6890
Compare
71ef91f
to
3a1d362
Compare
0cc6890
to
1b54f30
Compare
c46a244
to
b3c1106
Compare
ad600f0
to
017f471
Compare
b3c1106
to
a65ee0f
Compare
017f471
to
b7d429a
Compare
a65ee0f
to
cbb77b0
Compare
b7d429a
to
c99de22
Compare
cbb77b0
to
b2185c2
Compare
c99de22
to
d3254ad
Compare
b2185c2
to
3f98e56
Compare
d3254ad
to
7e21319
Compare
3f98e56
to
e24bf4e
Compare
7e21319
to
7cfe2c4
Compare
e24bf4e
to
2a740e8
Compare
2a740e8
to
dabc427
Compare
…le of function type
…unnecessarily; avoid generating errors/warnings about default Loc
…ionExpr to Value::Function, got things mostly back in shape
…for abilities in lambda_lifter.rs
…constraints to avoid reducing set of function type abilities when unifying types
…to bind leading arguments
…ser location on `||`
bab1e7d
to
4cf9a1a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
|
Full Node please.. |
Description
Extend syntax
move |args| body with copy+store
. Note that:has copy, store
because commas will confuse parsing in many situationhas copy+store
because that leads to nonuniform syntax withhas
with
, so that's what we're using.|T1, T2| T3 with copy+store
|a, b| f(x, 3, a, b)
EarlyBind
expression now takes a function-valued expression and a set of argument expressions, which correspond to a prefix of the function parameters.(|x, y| x + y)(2, 3)
Modify exp_builder and lambda_lifter to generate function values.
Modify model to track "used" functions in addition to "called" functions to be able to catch all dependencies when function values are created but not called.
Attaches an
AbilitySet
toType::Fun
andExp::Lambda
based on source. Adds a newExpCall
operation in parser/expansion ASTs to be able to carry more generalized function calls through to move-model, which already can support this throughInvoke
, which previously was underutilized. Added basic type checking for function abilities.Current Gaps
I was targeting the test cases
return_func.move
anddoable_func.move
, but this PR is still missingstore
for function values built by curry with only storable parametersI will try to patch those in while this is being reviewed, or add them to a later PR.
How Has This Been Tested?
Added more lambda tests under
move-compiler-v2/tests/lambda/
which are run "with" and "without" lambda features enabled. Currently, many things pass through to hit "not yet implemented" errors in bytecode gen, etc.Ran and carefully checked all tests under third_party and aptos.
Key Areas to Review
Key features are illustrated in test
move-compiler-v2/tests/lambda/storable/doable_func.move
and the two corresponding output files, along with the testreturn_func.move
in the same directory. Most other test outputs should be largely unchanged, although error messages related to lambda use in default configuration have changed.Tricky features are:
ty.rs
: unification checksFun
abilities as well as other things.lambda_lifter.rs
, we (1) reject lambdas withoutmove
free-var handling, (2) try to reduce lambda to curry, by checking for a simple function call with simple args, the last of which are identical to the lambda parameters.Type of Change
Which Components or Systems Does This Change Impact?
Checklist