aptos-core
aptos-core copied to clipboard
[Bug][move-compiler-v2] Cannot infer type for `*(abort 0)` in vector
🐛 Bug
module 0xCAFE::Module0 {
use 0x1::vector;
struct S has copy, drop {}
public fun f() {
let x: vector<S> = vector[
S {},
*(abort 0),
];
}
}
It can be compiled with V1 without extended checks (as in transactional tests).
It cannot be compiled by V2.
The error is:
error: unable to infer instantiation of type `&S` (consider providing type arguments or annotating the type)
┌─ TEMPFILE:8:14
│
8 │ *(abort 0),
│ ^^^^^^^^^