I\'m trying to understand why y is in scope in the following example:
static void Main(string[] args)
{
int x = 1;
if (x is int y) { }
That's is something I had found in VS15P4 (or P5) and it was being tracked on GitHub:
Definite assignment versus pattern-matching when pattern always matches #14651
Putting aside all the discussions, it is a scoping issue which occurs when the pattern always matches, as the title suggests.
I thought it was fixed before RC so I haven't actually tested afterwards but it seems the issue still persists.
Let's see if it will be fixed in the actual release, which is tomorrow :)