-
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][compiler-v2] ability missing warning comes too late #14490
Labels
Comments
This is the bytecode verifier as a verification step after code generation, and any error like this is definitely an unintended bug, though safe because the code can't be deployed. |
wrwg
added a commit
that referenced
this issue
Oct 18, 2024
Closes #14490 Move has some unusual semantics for ability checking of type parameters - In most contexts, a type parameter is assumed to have all abilities during checking. Then when the parameter is instantiated, checking takes place. - However, there is one exemption, namely when a type parameter is used to instantiate another type parameter which has an abilitie constraint, as in `f<T:drop>`. If we instantiate `f<R>` then `R` needs to be checked for `drop`. This PR solves this by adding a field `type_param_exempted` to `HasAbilities(abilities, type_param_exempted)` to the ability constraint.
16 tasks
wrwg
added a commit
that referenced
this issue
Oct 18, 2024
Closes #14490 Move has some unusual semantics for ability checking of type parameters - In most contexts, a type parameter is assumed to have all abilities during checking. Then when the parameter is instantiated, checking takes place. - However, there is one exemption, namely when a type parameter is used to instantiate another type parameter which has an abilitie constraint, as in `f<T:drop>`. If we instantiate `f<R>` then `R` needs to be checked for `drop`. This PR solves this by adding a field `type_param_exempted` to `HasAbilities(abilities, type_param_exempted)` to the ability constraint.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🐛 Bug
Compiling the following Move code with V2 compiler
yields an error at the File Format generation phase:
Which is a bit late in the process.
With V1 compiler, the error message is more dev-friendly:
The text was updated successfully, but these errors were encountered: