-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design
Description
Steps to Reproduce:
Given the following C# example:
using System;
public class C {
public void M() {
var test = new T();
if(test is T converTest == false)
return;
Console.WriteLine(converTest.Foo);
}
}
public class T{
public string Foo {get;set;}
}The following result is returned:
CS0165: Use of unassigned local variable 'converTest '
if converTest is null, the method return . why the output is CS0165 when using a is Constant pattern?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design