- Open Roslyn.sln in Visual Studio 2017
- Copy the method implementations for VisitSwitchOperator and RewriteSwitchOperator from the attached code sample source file CSharpCodeAnalysis\LocalRewriter_SwitchOperator.cs and paste them into source file %REPO_ROOT%\src\Compilers\CSharp\Portable\Lowering\LocalRewriter\LocalRewriter_SwitchOperator.cs.
- Build project csc.csproj to generate %REPO_ROOT%\Binaries\Debug\Exes\csc\csc.exe with our local changes.
- Create a new source file, say test.cs, with the following source code:
class Class{ public static void Main(string[] args) { System.Console.WriteLine(args.Length ?: [0, 1, 2] : ["Zero", "One", "Two", "More than two"]); }}
- Compile this source file with locally built csc.exe and verify ...