I have code equivalent to String.Join(',', new List<ulong>())
in a .NET Standard 2.0 project. I get two error from this line:
Argument 1: cannot convert from 'char' to 'string'
Argument 2: cannot convert from 'System.Collections.Generic.List<ulong>' to 'System.Collections.Generic.IEnumerable<string>'
These are the overloads of String.Join ReSharper shows on navigating to symbol:
I would assume that the second-last overload public static string Join<T>(char separator, IEnumerable<T> values);
would be selected, but this doesn't happen.
When I changed my code to String.Join<ulong>(',', new List<ulong>())
(explicitly specifying the generic type), the second error disappeared. Am I doing something incorrectly or is this a bug in VS?
","
? – Petrapetraccastring
– RadiomanIEnumerable<>
? Regaring the downvotes - perhaps not, but I can't improve a post unless I know what's wrong with it. – Radiomanchar
. Allstring.Join
overloads have first parameter of typestring
? Seems like Resharper shows you implementation of netstandard 2.0 not a contract. – WakenString.Join
overloads and none of them haschar
as a first argument though, not sure where did you get these 2 additional overloads. – Koselchar
? – WakenGo To Definition
will display correct overloads. – Waken