Repository navigation
feat(js/ts/python/dart/beam): support ArgumentException.ParamName - #5203
Merged
MangelMaxime merged 5 commits intoOct 29, 2026
Merged
MangelMaxime merged 5 commits into
MangelMaxime merged 5 commits into
Conversation
Map ArgumentException.ParamName (also read through ArgumentNullException and ArgumentOutOfRangeException) to the getter the library already has, instead of failing to compile. Constructors without a parameter name now store null rather than "", so an absent ParamName reads as null like on .NET. Messages are unchanged.
Map ArgumentException.ParamName to the getter the Dart library already has, instead of failing to compile. Dart strings are not nullable, so an absent parameter name keeps reading as an empty string.
Map ArgumentException.ParamName (also read through ArgumentNullException and ArgumentOutOfRangeException) to the getter the library already has, instead of failing to compile. Constructors without a parameter name now store None rather than "", so an absent ParamName reads as null like on .NET. Messages are unchanged.
Argument exception maps now carry a param_name key, which ArgumentException.ParamName reads (undefined, so null, when there is none). The compiler adds it for invalidArg, nullArg and the ArgumentException, ArgumentNullException and ArgumentOutOfRangeException constructors that take a parameter name, evaluating the name once, and the library adds it where fable_list, fable_resize_array and fable_int raise argument exceptions (fable_decimal already did). Messages are unchanged, except that ArgumentOutOfRangeException(paramName, actualValue, message) no longer uses the parameter name as its message and the message as its inner exception.
MangelMaxime
force-pushed
the
support-argument-paramname
branch
from
October 29, 2026 18:50
eba7733 to
6afb778
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lets Fable code read
ArgumentException.ParamName(also throughArgumentNullExceptionandArgumentOutOfRangeException) on JS/TS, Python, Dart and Beam, where it was a compile error. One commit per target.ParamNamecalls the library's existing getter. On JS/TS and Python, constructors without a name now storenull/Noneinstead of"", soParamNameisnullas on .NET. Messages don't change.param_namekey, set byinvalidArg,nullArg, the constructors that take a name, and the argument checks infable_list,fable_resize_arrayandfable_int.ArgumentOutOfRangeException(paramName, actualValue, message)used the name as its message; it now givesmessage (Parameter 'paramName').Difference from .NET: on Dart, a missing
ParamNamereads"", since Dart strings aren't nullable.Not covered:
List.exactlyOnesayslist(FSharp.Core:source), JS/TSList.transposesaysarray.[0], and JS/TSRandom.NextandQueue(capacity)pass their message as the name.ArgumentNullException(message, inner)and the otherArgumentOutOfRangeExceptionconstructors on JS/TS, Python and Dart.nullArgCheckstill raisesbadarg.Whichever of this PR and #5154 lands second will add
param_nameto #5154'sfable_list:argument_out_of_range/2.