You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.OverflowException: Value was either too large or too small for a UInt64.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Number.ParseUInt64(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
at System.UInt64.Parse(String s)
at Perlang.Parser.Scanner.Number() in /home/per/git/perlang/src/Perlang.Parser/Scanner.cs:line 327
at Perlang.Parser.Scanner.ScanToken() in /home/per/git/perlang/src/Perlang.Parser/Scanner.cs:line 265
at Perlang.Parser.Scanner.ScanTokens() in /home/per/git/perlang/src/Perlang.Parser/Scanner.cs:line 146
at Perlang.Interpreter.PerlangInterpreter.Eval(String source, ScanErrorHandler scanErrorHandler, ParseErrorHandler parseErrorHandler, ResolveErrorHandler resolveErrorHandler, ValidationErrorHandler typeValidationErrorHandler, ValidationErrorHandler immutabilityValidationErrorHandler, CompilerWarningHandler compilerWarningHandler) in /home/per/git/perlang/src/Perlang.Interpreter/PerlangInterpreter.cs:line 191
at Perlang.ConsoleApp.Program.Run(String source, CompilerWarningHandler compilerWarningHandler) in /home/per/git/perlang/src/Perlang.ConsoleApp/Program.cs:line 351
at Perlang.ConsoleApp.Program.RunPrompt() in /home/per/git/perlang/src/Perlang.ConsoleApp/Program.cs:line 345
at Perlang.ConsoleApp.Program.<>c__DisplayClass9_0.<MainWithCustomConsole>b__3(ParseResult parseResult, IConsole console) in /home/per/git/perlang/src/Perlang.ConsoleApp/Program.cs:line 180
We should handle this more gracefully; for example, in the REPL, this currently kills the execution.
The text was updated successfully, but these errors were encountered:
perlun
changed the title
Avoid OverflowException on integer assignment
'System.OverflowException: Value was either too large or too small for a UInt64' on integer assignment
Sep 10, 2021
The simple fix for now is to just parse them as `BitInteger`. An
interesting question is if we should support suffixes like L, U, UL etc,
as in C#. I think the simple answer is "we don't know", and we'll wait
with implementing things like that until there's a good-enough
motivation for it.
Closes#205
The simple fix for now is to just parse them as `BitInteger`. An
interesting question is if we should support suffixes like L, U, UL etc,
as in C#. I think the simple answer is "we don't know", and we'll wait
with implementing things like that until there's a good-enough
motivation for it.
Closes#205
The following program:
...currently fails with the following exception:
We should handle this more gracefully; for example, in the REPL, this currently kills the execution.
The text was updated successfully, but these errors were encountered: