-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate suitable error messages for current misuse of function-typed…
… 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.
- Loading branch information
1 parent
ac60da1
commit e1c6588
Showing
65 changed files
with
1,972 additions
and
126 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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ module 0x42::fields { | |
h: u64, | ||
} | ||
struct G { | ||
f: #0, | ||
f: X, | ||
} | ||
struct S { | ||
f: u64, | ||
|
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 |
---|---|---|
|
@@ -42,7 +42,7 @@ module 0xc0ffee::m { | |
enum Option { | ||
None, | ||
Some { | ||
value: #0, | ||
value: A, | ||
} | ||
} | ||
enum Outer { | ||
|
6 changes: 3 additions & 3 deletions
6
third_party/move/move-compiler-v2/tests/checking/abilities/v1/ability_constraints.exp
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
10 changes: 5 additions & 5 deletions
10
third_party/move/move-compiler-v2/tests/checking/abilities/v1/phantom_param_op_abilities.exp
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
20 changes: 10 additions & 10 deletions
20
...move/move-compiler-v2/tests/checking/abilities/v1/phantom_params_constraint_abilities.exp
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
8 changes: 4 additions & 4 deletions
8
...arty/move/move-compiler-v2/tests/checking/abilities/v1/phantom_params_field_abilities.exp
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
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
Oops, something went wrong.