-
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
[Bug][move-compiler-v2] problems with errors about lambda types in test hide panics due to missing error checks #14633
Closed
brmataptos opened this issue
Sep 14, 2024
· 0 comments
· Fixed by brmataptos/aptos-core#1 or #14742 · May be fixed by #14732
Closed
[Bug][move-compiler-v2] problems with errors about lambda types in test hide panics due to missing error checks #14633
brmataptos opened this issue
Sep 14, 2024
· 0 comments
· Fixed by brmataptos/aptos-core#1 or #14742 · May be fixed by #14732
Labels
Comments
brmataptos
changed the title
[Bug][move-compiler-v2] problems with errors about lambda types
[Bug][move-compiler-v2] problems with errors about lambda types in test hide panics due to missing errors
Sep 14, 2024
brmataptos
changed the title
[Bug][move-compiler-v2] problems with errors about lambda types in test hide panics due to missing errors
[Bug][move-compiler-v2] problems with errors about lambda types in test hide panics due to missing error checks
Sep 14, 2024
brmataptos
added a commit
that referenced
this issue
Sep 24, 2024
… values, lay groundwork for implementing and testing more general lambdas. Fixes #14633. Catch all errors in test/checking/typing/lambda.move in Compiler V2, after splitting and gradually commenting out code as lambda[2-5].move to avoid shadowing by other errors. - add checking for function-typed function results in `function_checker` - Change `internal_error` to `error` in `bytecode_generator` and `module_generator` to properly show "error" rather than "bug" if lambdas are mistakenly used as values today. - tag some code to show where changes are needed to support lambda: // TODO(LAMBDA) - fix unused_params_checker and recursive_struct_checker to tolerate lambda types - add experiments to control enabling of various aspects of lambda support: - LAMBDA_PARAMS, LAMBDA_RESULTS to allow lambdas as general function params or results - LAMBDA_FIELDS - support lambdas in struct fields - LAMBDA_VALUES - support lambdas in general-purpose values - may add LAMBDA_TYPE_PARAMS later - update lambda-lifting test config to use those flags rather than disabling checks - add a `result_type_loc` field to move-model's `FunctionData` (and model-builder's `FunEntry`) to more precisely locate errors in function result types. - Fix `GlobalEnv::internal_dump_env` to use function- and struct-specific type contexts so that types are shown with correct type parameter names. - Check that struct fields are not functions.
brmataptos
added a commit
to brmataptos/aptos-core
that referenced
this issue
Sep 24, 2024
… points for more complete lambda implementation
This was referenced Sep 24, 2024
brmataptos
added a commit
that referenced
this issue
Sep 28, 2024
…r more complete lambda implementation
brmataptos
added a commit
that referenced
this issue
Oct 3, 2024
…r more complete lambda implementation
brmataptos
added a commit
to brmataptos/aptos-core
that referenced
this issue
Oct 3, 2024
… points for more complete lambda implementation (#1) Catch all errors in `move-compiler-v2/tests/checking/typing/lambda.move` in Compiler V2, after splitting and gradually commenting out code as `lambda[2-5].move`, to avoid shadowing by other errors. Lay groundwork for support of lambdas in various capacities. - tag some code to show where changes are needed to support lambda: // TODO(LAMBDA) - fix unused_params_checker and recursive_struct_checker to tolerate lambda types - add experiments to control enabling of various aspects of lambda support - update lambda-lifting test config to use those flags rather than disabling checks - Fix `GlobalEnv::internal_dump_env` to use function- and struct-specific type contexts so that types are shown with correct type parameter names. - Check that struct fields are not functions.
github-project-automation
bot
moved this from 🆕 New
to ✅ Done
in Move Language and Runtime
Oct 3, 2024
brmataptos
added a commit
that referenced
this issue
Oct 3, 2024
…r more complete lambda implementation
brmataptos
added a commit
that referenced
this issue
Oct 10, 2024
…r more complete lambda implementation
brmataptos
added a commit
that referenced
this issue
Oct 10, 2024
…fy change points for more complete lambda implementation (#14742) Catch all errors in move-compiler-v2/tests/checking/typing/lambda.move in Compiler V2, after splitting and gradually commenting out code as lambda[2-5].move, to avoid shadowing by other errors. Lay groundwork for support of lambdas in various capacities. Fixes #14633. - add checking for function-typed function results in function_checker, and functions in parameters and results of function types in both args and results to functions there. - to properly show "error" rather than "bug" if lambdas are mistakenly used as values today. - tag some code to show where changes are needed to support lambda: // TODO(LAMBDA) fix unused_params_checker and recursive_struct_checker to tolerate lambda types - add experiments to control enabling of various aspects of lambda support: - add a result_type_loc field to move-model's FunctionData (and model-builder's FunEntry) to more precisely locate errors in function result types. - Fix GlobalEnv::internal_dump_env to use function- and struct-specific type contexts so that types are shown with correct type parameter names. - Check that struct fields are not functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug
Comparing
We see:
action
(|&T|
) being different from the type which would be expected from the context in which it is used (|(&T, u64)|_
). The user will be confused by this, since the entire expression is pointed to. This should be changed to clarify somehow:x: u64
:+
and say something like:a value of reference type &integer is not allowed as an argument to operator +
.recursive_struct_checker.rs:105
.The following is the part of the test code that doesn't yield an error and falls through to panic:
The text was updated successfully, but these errors were encountered: