I know that if i assign the as? to a variable so the compiler won't bother about safe cast issue. For example:
w:Wolf? = Wolf()
wolf = w as? Wolf
Now i can use variable wolf to call any public member of Wolf without using a question mark (no need for safe call)
but if the as? is inside an if block and item variable not being assign. For example:
if (item as? CountryDataItem != null)
{
// code that is using *item*
}
else{
}
Does the code inside the if block can use item as a CountryDataItem without a need of cast and without the compiler remarking about safe calls when using the CountryDataItem The question is from the reason that the item isn't being save in any variable so i'm not sure how the compiler consider him?