(all) Support int
literals in addition to double
s
#40
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.
I decided to use
dynamic
to implement this for now. It's the simplest way to not having to handle all various combinations of integer types manually.Doing it like this made it quite easy in the end, it felt impossible just some day ago. :)
As for how to handle integer literals, I decided to with the same rules are C# applies for now.
(quoting https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types)
The suffix stuff is not supported at the moment; we provide no way to explicitly specify neither
ulong
,uint
ordouble
. This will probably have to fixed at some point, but just supporting various integer types anddouble
is probably a good start. (We could do the same for the floating point values btw, to coerce them intofloat
ifthe encountered floating point literal is small enough.)