Skip to content

Conversation

@elegios
Copy link
Contributor

@elegios elegios commented Mar 18, 2025

Json doesn't distinguish between Int and Float, it only has numbers, but our json library does (to be more convenient with the rest of the system). This means that something that looks like an Int (no fractional part) will be parsed to JsonInt even if our program expected a Float in that position. The easiest way to deal with this is to let the deserialization function used after parsing (jsonDeserializeFloat) automatically promote to Float if it encounters a JsonInt.

@david-broman david-broman merged commit 0a7eb7b into miking-lang:develop Mar 25, 2025
1 of 2 checks passed
@elegios elegios deleted the auto-promote-json-int branch April 16, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants