Fix restrictive numeric casts/assignments. #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow type conversion on redefine if the casting matrix says the types have a common base.
Allow bool->float conversion.
This fixes the following ink:
Spotted because I have a global in my story which starts at zero (so is exported as an integer type) and later I add a float to it, at which point the inkcpp runtime falls over, whereas the C# runtime will coerce the type to the destination if possible.
This passed all the tests for me, and probably needs a new inkcpp or ink-proof test? I'm not sure if the casting matrix query I added is too permissive, but it does fail if e.g. you try and redefine a divert variable to a numeric type, which matches C# runtime behaviour.