Open leighmcculloch opened 6 months ago
Looks like just SDK change to implement the trait and call env convert.rs
The TryFromVal
are all implemented for the types themselves (@anupsdf's finding above), not references.
So doing let v: Val = (0i128,).into_val(&env);
without the &
sign will work.
@leighmcculloch is there a reason why it needs to work with the references?
@jayz22 I've tried to always provide both so that we can have a ref of something and still get a Val out of it.
If you have a ref of something and first need to get an owned value of it, that's tricky, because then you need it to impl ToOwned
or Clone
, and types may not implement those things.
What version are you using?
20.0.0
What did you do?
What did you expect to see?
Compiled, because all types are supposed to be value convertible
0i128.into_val(&env)
, ref convertible(&0i128).into_val(&env)
, and tuple convertible `(&0i128,).into_val(&env).What did you see instead?
Compile error: