Fixed conversion of large uint/ulong/long hex literals #1152
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.
Problem
#1147 (Edit: Issue is duplicate of reopened #754)
Hex literals of numeric types uint, ulong and long with larger values than int.MaxValue failed to convert as there was a special case for int hex literals, where the numeric value is parsed to an int causing a wrong conversion.
Solution
Restricting this special case (8 digit hex literal) to values of type int only.
#1115 resolved issue #1064 for integer values but long hex literals (16 digit hex literal) seem to have the same issue:
0xFFFFFFFFFFFFFFFEL is interpreted as uint64 instead of int64.
So this PR also applies the same solution to convert
Private Const LargeLong As Long = &HFFFFFFFFFFFFFFFEL
to
private const long LargeLong = unchecked((long)0xFFFFFFFFFFFFFFFE);