The call is ambiguous between the following methods or properties

Both constructors take the same number of arguments, but in a different order. Since you have specified default values for the two constructor parameters the compiler cannot distinguish between the two overloads when the second argument is not supplied.

I would advise you to remove the existing constructors and replace with the following:

public SomeClass(string a, Color? color, Font font)
{
    // constructor implementation
}

public SomeClass(string a) : this(a, null, null) {}
public SomeClass(string a, Color color) : this(a, color, null) {}
public SomeClass(string a, Font font) : this(a, null, font) {}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)