Closed tpdickso closed 7 years ago
I can do the same for AnyHashableLuaValue
, if wanted. It might be inconsistent to have one perform coercion and the other not.
Alternatively, there could be a third type, AnyExactLuaValue
or something along those lines...
It's definitely something desirable to have the AnyLuaValue
that actually matches the exact type of the variable.
Since it's more or less a bugfix, I guess I'll just merge that despite the breaking change.
Thanks!
This is a breaking change, as it was previously the case that parsing a numeric string such as "-2" would return a
AnyLuaValue::LuaNumber
. It's up to the maintainer whether this is desired.The code is ugly-branchy, since the two branches don't have the same type (the repeated parsing builds up
&
s on thelua
variable.)