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
commit 27654b066e600a350706a13ebd67d1da542c1a7b
Merge: 436d17816f6 0c9f90368a5
Author: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com>
Date: Thu May 7 05:33:48 2020 +0000
Merge pull request #44029 from dotnet/merges/release/dev16.7-preview1-to-master
Merge release/dev16.7-preview1 to master
Steps to Reproduce:
Compile the following code:
using System;publicclassC{publicvoidTest1(string?x){switch(x){casestring _:
Console.WriteLine(x.Length);// no warningsbreak;}}publicvoidTest2(string?x){switch(x,1){case(string _, _):
Console.WriteLine(x.Length);// False CS8602: Dereference of a possibly null reference.break;}}}publicclassD{publicvoidTest1(stringx){switch(x){casenull:
Console.WriteLine(x.Length);// CS8602: Dereference of a possibly null reference.break;}}publicvoidTest2(stringx){switch(x,1){case(null, _):
Console.WriteLine(x.Length);// missing warningbreak;}}}
Expected Behavior:
No warnings in both methods in class C
Warnings in both methods in class D
Actual Behavior:
Roslyn doesn't update matched variables' nullability when a switche's governing expression is a tuple expression
The text was updated successfully, but these errors were encountered:
Version Used:
Steps to Reproduce:
Compile the following code:
Expected Behavior:
No warnings in both methods in class
C
Warnings in both methods in class
D
Actual Behavior:
Roslyn doesn't update matched variables' nullability when a switche's governing expression is a tuple expression
The text was updated successfully, but these errors were encountered: