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
It looks like receiver-style syntax doesn’t work correctly with generic functions with single argument (occurs with Any and Object functions)
Example:
this works:
let value = pack(S { x: 22 });
assert!(unpack<S>(value) == S { x: 22 }, 2);
this doesn’t:
let value = pack(S { x: 22 });
assert!(value.unpack<S>() == S { x: 22 }, 2);
With error:
error: field `unpack` not declared in struct `Any`
┌─ aptos-move/framework/aptos-framework/../aptos-stdlib/sources/any.move:62:17
│
62 │ assert!(value.unpack<S>() == S { x: 22 }, 2);
│ ^^^^^
error: cannot use `S` with an operator which expects a value of type `integer`
┌─ aptos-move/framework/aptos-framework/../aptos-stdlib/sources/any.move:62:30
│
62 │ assert!(value.unpack<S>() == S { x: 22 }, 2);
│ ^
error: no arguments provided for pack, expected 1
┌─ aptos-move/framework/aptos-framework/../aptos-stdlib/sources/any.move:62:30
│
62 │ assert!(value.unpack<S>() == S { x: 22 }, 2);
│ ^
error: cannot use `()` with an operator which expects a value of type `integer`
┌─ aptos-move/framework/aptos-framework/../aptos-stdlib/sources/any.move:62:32
│
62 │ assert!(value.unpack<S>() == S { x: 22 }, 2);
To reproduce
this line doesn't compile - ae8cfde - when using move 2 compiler / features.
The text was updated successfully, but these errors were encountered:
🐛 Bug
It looks like receiver-style syntax doesn’t work correctly with generic functions with single argument (occurs with Any and Object functions)
Example:
this works:
this doesn’t:
With error:
To reproduce
this line doesn't compile - ae8cfde - when using move 2 compiler / features.
The text was updated successfully, but these errors were encountered: