I was reading about new out variable features in C#7 here. I have two questions:
It says
We allow \"discards\" as out parameters as w
In C# 7.0 (Visual Studio 2017 around March 2017), discards are supported in assignments in the following contexts:
Other useful notes
Simple example : here we do not want to use the 1st and 2nd params and only need the 3rd param
(_, _, area) = city.GetCityInformation(cityName);
Advanced example in switch case which used also modern switch case pattern matching (source)
switch (exception) {
case ExceptionCustom exceptionCustom:
//do something unique
//...
break;
case OperationCanceledException _:
//do something else here and we can also cast it
//...
break;
default:
logger?.Error(exception.Message, exception);
//..
break;
}