Skip to content

string.Concat overload is internal instead of public #127907

@LeviGNMBS

Description

@LeviGNMBS

Description

Hi, i wanted to report the following issue:

This string.Concat overload:

internal static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2, ReadOnlySpan<char> str3, ReadOnlySpan<char> str4)

https://github.com/dotnet/dotnet/blob/95335fdf41878a6dbec1ba88eb69dda4a90ec655/src/runtime/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs#L351
is internal, its counterparts however are all public:

public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1)
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2)
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2, ReadOnlySpan<char> str3)

This causes user code cannot reach the method, even though its just the same logic as the others but with one more parameter? Could have been an oversight?

Thank you for checking if this is intended. Sorry for the short form report, i think this is very self-explanatory.

Reproduction Steps

Try to run:
string.Concat("a".AsSpan(), "2", "t", "4", "e");
gives an error instead of compiling

Expected behavior

Code compiles

Actual behavior

Code gives error

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions