You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version Used: 3.1.100-preview1-014459 (but reproduced in earlier versions)
Steps to Reproduce:
using System;staticclassDemo{staticvoidNotOkCase(objectobj){if((obj isstring s)==false){
Console.WriteLine("obj is not a string");}else{//uh-oh use of unassigned variable//Console.WriteLine(s);}}staticvoidOkCase(objectobj){if(!(obj isstring s)){
Console.WriteLine("obj is not a string");}else{
Console.WriteLine(s);}}}
Expected Behavior:
I can use 's' in NotOkCase.
Actual Behavior:
I can't.
The text was updated successfully, but these errors were encountered:
vabka
changed the title
Strange behaviour of pattern matching (obj is Type val)
Strange behaviour of pattern matching
Nov 7, 2019
Version Used: 3.1.100-preview1-014459 (but reproduced in earlier versions)
Steps to Reproduce:
Expected Behavior:
I can use 's' in NotOkCase.
Actual Behavior:
I can't.
The text was updated successfully, but these errors were encountered: