c# - Nullable short and array -
i got this
public string myfunction() { return myfunction(null); } public string myfunction(short? variable) { if null else else return string; }
now i'm trying make like
public string myfunction(short[] variable) { string a; foreach(var z in variable) = +" "+ myfunction(z); }
but recive error
the call ambiguous between following methods or properties
is possible stay 1 parameter cause know makin' function 2 params resolve problem still using 1 param. it's impossible replace null chosen number (e.g. 0).
you can use cast resolve ambiguity:
return myfunction((short?)null);
without cast there no way compiler detect function want invoke.
Comments
Post a Comment