Description
Full issue information + repro project:
https://github.com/just-ero/roslyn-issues-repros/tree/main/4.14.0/007_ConvertToTopLevelStatements_PreprocessorDirectives
Version
Roslyn: 4.14.0-3.25178.1 (1a06295)
Steps to Reproduce
- Add the following code wherever syntactically applicable:
or:
class Program { static void Main() { #if true Console.WriteLine("true"); #else Console.WriteLine("false"); #endif } }
class Program { static void Main() { #if false Console.WriteLine("false"); #else Console.WriteLine("true"); #endif } }
- Apply "Convert to top-level statements" on
Main
.
Expected Behavior
#if true
Console.WriteLine("true");
#else
Console.WriteLine("false");
#endif
and
#if false
Console.WriteLine("false");
#else
Console.WriteLine("true");
#endif
respectively.
Actual Behavior
#if true
Console.WriteLine("true");
and
#if false
Console.WriteLine("false");
#else
Console.WriteLine("true");
respectively.
Metadata
Metadata
Assignees
Type
Projects
Status
Completed