附录二
public SomeClass(string a, Color? c = null, Font d = null)
{
// ...
}
public SomeClass(string a, Font c = null, Color? d = null)
{
// ...
}
我这样做:
SomeClass sc = new SomeClass("Lorem ipsum");
I ll get this: "Error 1 The call is ambiguous between the following methods or properties [...]"
在我看来,我指的是什么时候了,因为最终结果相同(至少就这一具体情况而言,对我来说,现在所有事情都如此),所以我可以选择什么来解决这一问题?
EDIT 1: @oltman: Simplified example.
I just want to be able to write
[...] new SomeClass("Lorem", Color.Green)
instead of
[...] new SomeClass("Lorem", null, Color.Green)