Passing null as one of the arguments

suggest change

If you have

void F1(MyType1 x) {
    // do something
}

void F1(MyType2 x) {
    // do something else
}

and for some reason you need to call the first overload of F1 but with x = null, then doing simply

F1(null);

will not compile as the call is ambiguous. To counter this you can do

F1(null as MyType1);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents