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
pragma ton-solidity ^0.44.0;
contract Mem {
constructor() public {
tvm.accept();
}
function test() internal returns (optional(uint256)) {
TvmSlice data = msg.data;
return data.decode(optional(uint256));
}
}
and getting compilation Error: Return argument type optional(optional(uint256)) is not implicitly convertible to expected type (type of first return variable) optional(uint256).
So the type checker for some reason thinks that expression data.decode(optional(uint256)) has type optional(optional(uint256)).
And when compiling this code
pragma ton-solidity ^0.44.0;
contract Mem {
constructor() public {
tvm.accept();
}
struct Struct {
optional(uint256) value;
}
function test() internal returns (Struct) {
TvmSlice data = msg.data;
return data.decode(Struct);
}
}
I get "Unsupported parameter type for decoding: optional(uint256)". So optional type seems to be TvmBuilder.store'able, but not TvmSlice.decode'able, and that is pretty not convenient.
I hope you will support decoding optional types in a next release.
The text was updated successfully, but these errors were encountered:
I'm trying to compile the following program
and getting compilation Error: Return argument type optional(optional(uint256)) is not implicitly convertible to expected type (type of first return variable) optional(uint256).
So the type checker for some reason thinks that expression data.decode(optional(uint256)) has type optional(optional(uint256)).
And when compiling this code
I get "Unsupported parameter type for decoding: optional(uint256)". So
optional
type seems to beTvmBuilder.store
'able, but notTvmSlice.decode
'able, and that is pretty not convenient.I hope you will support decoding optional types in a next release.
The text was updated successfully, but these errors were encountered: