This project is read-only.
1
Vote

Wrong ConvertedType at "params" parameter

description

Consider the following methods:

public static string Format(string format, object arg0);
public static string Format(IFormatProvider provider, string format, params object[] args);

on invocation:
double r = 2;
Format("{f:5}", r);
At "r" GetTypeInfo gives

Type = System.Double
ConvertedType = System.Object

But
Format(provider, "{f:5}", r);
At "r" GetTypeInfo gives

Type = System.Double
ConvertedType = System.Double

Accordingly, in the first case ConversionInfo says Boxing, but Identity in the second.

I would expect the same in both cases. Am I wrong?
I use Roslyn 1.0

comments

PauloMorgado wrote Sep 11, 2015 at 10:57 AM