Please Help!
What am I doing wrong?
static void f1(Color color, params float[] f)
{
System.Console.WriteLine("Here is f1 for float");
}
static void f1(Color color, params int[] f)
{
System.Console.WriteLine("Here is f1 for int");
}
static void Main()
{
f1(null,0);
}
I can’t invoke f1(null,0); I get compile time error.
How this staff can be overcome assuming I indeed need those method signatures?
EDIT: As for Compile-tme error – ReSharper complains:
Cannot resolve method f1(null,int), candidates are:
void f1(Syste.Drawing.Color, params[] float)
void f1(Syste.Drawing.Color, params[] int)
I think the problem is you are passing null for Color which might be upsetting the function, either change that to
Color?(since it is a struct) or pass a valid Color value