Skip to content

Add [int128] and [uint128] to the list of types PowerShell recognizes as integer types, so as to support the usual from-string conversions #25372

Description

@mklement0

Summary of the new feature / enhancement

The list of integer types in the following source-code location is currently missing the .NET 7+ System.Int128 and System.UInt128 types:

private static readonly Type[] s_integerTypes = new Type[] {
typeof(Int16), typeof(Int32), typeof(Int64),
typeof(UInt16), typeof(UInt32), typeof(UInt64),
typeof(sbyte), typeof(byte)
};

The absence of this type from this list means that something like [int128] '1,000', which works for all other (primitive) integer types, doesn't work.

Note that [int128] and [uint128], like [bigint], are not .NET primitive types.

There's a problem with [bigint] too, discussed in the following issue, which also touches on how the current fallback to [double]::Parse() for input strings with , is also problematic for [long] and [ulong], which would therefore also affect [int128] and [uint128]:

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimeWG-ReviewedA Working Group has reviewed this and made a recommendation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions