You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module app::m {
use aptos_stdlib::type_info;
fun generic_type_info_verification_target<A>(): type_info::TypeInfo {
type_info::type_of<A>()
}
spec generic_type_info_verification_target {
ensures result == generic_type_info_verification_target<A>();
}
}
This yields in the following Boogie compilation error:
Move prover returns: [internal] boogie exited with compilation errors:
type_reflection.bpl(5059,26): Error: cannot refer to a global variable in this context: #0_info
type_reflection.bpl(5059,38): Error: cannot refer to a global variable in this context: #0_info
type_reflection.bpl(5059,50): Error: cannot refer to a global variable in this context: #0_info
This seems to be a bug in the new specification function inferrer shared between compiler v1 and v2. The native function type_info::type_of cannot be called from a specification function as it refers to type reflection state #0_info.
The text was updated successfully, but these errors were encountered:
A specification function which uses `type_info::type_of<A>` where `A` is a type parameter implicitly depends on the Boogie global variable `#0_info`. However, that variable is not added to the Boogie function parameters. This PR adds logic to add additional parameters to specification functions capturing this dependency, if needed.
The issue seem to have been present since we introduced TypeInfo verification (so both in compiler v1 and v2) but hasen't surfaced yet as it appears that for framework verification, the problem is not hit.
Tested by a new case in prover `type_reflection.move` test.
Closes#14205
A specification function which uses `type_info::type_of<A>` where `A` is a type parameter implicitly depends on the Boogie global variable `#0_info`. However, that variable is not added to the Boogie function parameters. This PR adds logic to add additional parameters to specification functions capturing this dependency, if needed.
The issue seem to have been present since we introduced TypeInfo verification (so both in compiler v1 and v2) but hasen't surfaced yet as it appears that for framework verification, the problem is not hit.
Tested by a new case in prover `type_reflection.move` test.
Closes#14205
Consider code like:
This yields in the following Boogie compilation error:
This seems to be a bug in the new specification function inferrer shared between compiler v1 and v2. The native function
type_info::type_of
cannot be called from a specification function as it refers to type reflection state#0_info
.The text was updated successfully, but these errors were encountered: