guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 1e78c108e5e3bce2f53437baf1390545c11c184b
Author: Danny Milosavljevic <[email protected]>
AuthorDate: Wed Apr 8 17:09:15 2026 +0200

    gnu: Add [email protected].
    
    * gnu/packages/patches/roslyn-3.8.0-bootstrap-with-csc-3.2.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add reference to it.
    * gnu/packages/dotnet.scm (roslyn-3.8): New variable.
    (roslyn): New variable.
    
    Change-Id: I29bd9d1f2f29965856653b3cb67c6655e863fc74
---
 gnu/local.mk                                       |    1 +
 gnu/packages/dotnet.scm                            |  445 +++++++
 .../roslyn-3.8.0-bootstrap-with-csc-3.2.patch      | 1366 ++++++++++++++++++++
 3 files changed, 1812 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 591e787b16..99140d48ce 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2429,6 +2429,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/roslyn-2.8.2-csharp-7.2-for-csc-2.3.patch       \
   %D%/packages/patches/roslyn-3.0.0-bootstrap-with-csc-2.8.patch       \
   %D%/packages/patches/roslyn-3.2.0-bootstrap-with-csc-3.0.patch       \
+  %D%/packages/patches/roslyn-3.8.0-bootstrap-with-csc-3.2.patch       \
   %D%/packages/patches/rottlog-direntry.patch                  \
   %D%/packages/patches/ruby-actionpack-remove-browser-tests.patch      \
   %D%/packages/patches/ruby-activesupport-fix-deprecation-warning.patch        
\
diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm
index 6f423de54c..350147536a 100644
--- a/gnu/packages/dotnet.scm
+++ b/gnu/packages/dotnet.scm
@@ -3010,6 +3010,451 @@ a C# 8.0 compiler.")))
 from source using @code{roslyn-3.0} as the bootstrap compiler.  It adds
 support for the @code{notnull} generic constraint, which is needed to build
 newer Roslyn versions.")))
+
+
+;;;
+;;; roslyn-3.8: inherits roslyn-3.2, built with csc 3.2
+;;; This is the target version for Mono 6.12 compatibility.
+;;;
+
+(define-public roslyn-3.8
+  (package
+    (inherit roslyn-3.2)
+    (version "3.8.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/dotnet/roslyn";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name "roslyn" version))
+       (sha256
+        (base32
+         "0z003zysqbd35dmw5dby3rs4471cb8qh5jlswyibc4qffh0dkfx4"))
+       (patches
+        (search-patches "roslyn-3.8.0-bootstrap-with-csc-3.2.patch"))))
+    (native-inputs (list roslyn-3.2))
+    (arguments
+     (substitute-keyword-arguments (package-arguments roslyn-3.2)
+       ((#:phases phases '())
+        #~(modify-phases #$phases
+            (replace 'create-csc-rsp
+              (lambda _
+                (call-with-output-file "csc.rsp"
+                  (lambda (port)
+                    (display "-langversion:preview\n-d:NET472\n" port)))))
+
+            ;; Point at roslyn-3.2's csc.
+            (replace 'create-csc-wrapper
+              (lambda* (#:key inputs #:allow-other-keys)
+                (mkdir-p "bootstrap-bin")
+                (call-with-output-file "bootstrap-bin/csc"
+                  (lambda (port)
+                    (format port "#!~a~%exec mono ~a \"$@\"~%"
+                            (which "bash")
+                            (string-append (assoc-ref inputs "roslyn") 
"/lib/roslyn/csc.exe"))))
+                (chmod "bootstrap-bin/csc" #o755)
+                (setenv "PATH"
+                        (string-append (getcwd) "/bootstrap-bin:"
+                                       (getenv "PATH")))))
+
+            ;; 3.8 has more files with PathUtilities ambiguity
+            ;; between SRM's and Roslyn's PathUtilities classes.
+            ;; PathUtilities ambiguity already handled by the patch.
+            (delete 'fix-srm-inline)
+            (delete 'fix-srm-inline-3.0)
+
+            ;; Mono 6.12's mscorlib provides NotNullWhenAttribute etc.
+            ;; (backported from .NET Core 3.0), but NOT MemberNotNullAttribute
+            ;; or MemberNotNullWhenAttribute (added in .NET 5).
+            ;; Replace the polyfill file: remove types that conflict with
+            ;; mscorlib, keep the two that Mono lacks.
+            (replace 'remove-stale-files
+              (lambda _
+                (for-each
+                 (lambda (f) (when (file-exists? f) (delete-file f)))
+                 
'("src/Compilers/Core/Portable/DiaSymReader/Utilities/IUnsafeComStream.cs"
+                   
"src/Compilers/Core/Portable/DiaSymReader/Utilities/ComMemoryStream.cs"
+                   ;; Index/Range polyfills are internal and shadow
+                   ;; Mono 6.12's public mscorlib types.  Delete so
+                   ;; csc finds the mscorlib versions.
+                   "src/Compilers/Core/Portable/InternalUtilities/Index.cs"
+                   "src/Compilers/Core/Portable/InternalUtilities/Range.cs"))
+                (call-with-output-file
+                    
"src/Compilers/Core/Portable/InternalUtilities/NullableAttributes.cs"
+                  (lambda (port)
+                    (display
+"namespace System.Diagnostics.CodeAnalysis
+{
+    [System.AttributeUsage(System.AttributeTargets.Method | 
System.AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
+    internal sealed class MemberNotNullAttribute : System.Attribute
+    {
+        public MemberNotNullAttribute(string member) => Members = new[] { 
member };
+        public MemberNotNullAttribute(params string[] members) => Members = 
members;
+        public string[] Members { get; }
+    }
+
+    [System.AttributeUsage(System.AttributeTargets.Method | 
System.AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
+    internal sealed class MemberNotNullWhenAttribute : System.Attribute
+    {
+        public MemberNotNullWhenAttribute(bool returnValue, string member) { 
ReturnValue = returnValue; Members = new[] { member }; }
+        public MemberNotNullWhenAttribute(bool returnValue, params string[] 
members) { ReturnValue = returnValue; Members = members; }
+        public bool ReturnValue { get; }
+        public string[] Members { get; }
+    }
+}
+" port)))))
+
+            ;; 3.8 removed DesktopShim, DesktopBuildClient, and
+            ;; DesktopAnalyzerAssemblyLoader source files.  The inherited
+            ;; compile phase still references them; create empty stubs.
+            (add-before 'compile 'create-desktop-stubs
+              (lambda _
+                (for-each
+                 (lambda (f)
+                   (unless (file-exists? f)
+                     (call-with-output-file f
+                       (lambda (port) (newline port)))))
+                 '("src/Compilers/Shared/DesktopShim.cs"
+                   "src/Compilers/Shared/DesktopBuildClient.cs"
+                   "src/Compilers/Shared/DesktopAnalyzerAssemblyLoader.cs"))))
+
+            ;; Core IVT needs Scripting and VB assembly names so they
+            ;; can access internal APIs.
+            (replace 'build
+              (lambda _
+                ;; Bootstrap SR class from SRM string resources.
+                ;; Roslyn 2.0-3.2: resx at src/Dependencies/.../Strings.resx
+                ;; Roslyn 3.8+: resx at %srm-source-dir/Resources/Strings.resx
+                (invoke "resx2sr" "-o" "srm-strings.cs" "-n" "System.SR"
+                        "--warn-mismatch"
+                        (string-append #$%srm-source-dir 
"/Resources/Strings.resx"))
+                (invoke "resx2sr" "-o" "bootstrap-sr.cs" "-n"
+                        "Microsoft.CodeAnalysis.CodeAnalysisResources"
+                        
"src/Compilers/Core/Portable/CodeAnalysisResources.resx")
+                ;; SR.Format wrappers (resx2sr only generates constants;
+                ;; SRM code calls SR.Format for string interpolation).
+                (call-with-output-file "srm-strings-format.cs"
+                  (lambda (port)
+                    (display
+"namespace System {
+partial class SR {
+    internal static string Format(string f, object a0) => string.Format(f, a0);
+    internal static string Format(string f, object a0, object a1) => 
string.Format(f, a0, a1);
+    internal static string Format(string f, object a0, object a1, object a2) 
=> string.Format(f, a0, a1, a2);
+    internal static string Format(string f, params object[] args) => 
string.Format(f, args);
+}
+}
+" port)))
+                ;; CodeAnalysisResources.ResourceManager property
+                ;; (needed by diagnostic message formatting).
+                (call-with-output-file "bootstrap-resourcemanager.cs"
+                  (lambda (port)
+                    (display
+"namespace Microsoft.CodeAnalysis {
+partial class CodeAnalysisResources {
+    static System.Resources.ResourceManager _rm;
+    public static System.Resources.ResourceManager ResourceManager {
+        get {
+            if (_rm == null)
+                _rm = new System.Resources.ResourceManager(
+                    \"Microsoft.CodeAnalysis.CodeAnalysisResources\",
+                    typeof(CodeAnalysisResources).Assembly);
+            return _rm;
+        }
+    }
+}
+}
+" port)))
+                ;; Core IVT: allow CSharp, VB, Scripting, csc, csi, vbc.
+                (call-with-output-file "bootstrap-ivt.cs"
+                  (lambda (port)
+                    (for-each
+                     (lambda (asm)
+                       (format port
+                               "[assembly: 
System.Runtime.CompilerServices.InternalsVisibleTo(~s)]~%"
+                               asm))
+                     '("Microsoft.CodeAnalysis.CSharp"
+                       "Microsoft.CodeAnalysis.VisualBasic"
+                       "Microsoft.CodeAnalysis.Scripting"
+                       "Microsoft.CodeAnalysis.CSharp.Scripting"
+                       "csc" "csi" "vbc" "VBCSCompiler"))))
+                ;; CSharp IVT: allow csc, csi, CSharp.Scripting.
+                (call-with-output-file "bootstrap-csharp-ivt.cs"
+                  (lambda (port)
+                    (format port "using System.Runtime.CompilerServices;
+using System.Reflection;
+[assembly: InternalsVisibleTo(\"csc\")]
+[assembly: InternalsVisibleTo(\"csi\")]
+[assembly: InternalsVisibleTo(\"Microsoft.CodeAnalysis.CSharp.Scripting\")]
+[assembly: AssemblyVersion(\"~a.0\")]
+[assembly: AssemblyFileVersion(\"~a.0\")]
+[assembly: AssemblyInformationalVersion(\"~a\")]
+" #$(package-version this-package)
+  #$(package-version this-package)
+  #$(package-version this-package))))
+                ;; Scripting IVT: allow CSharp.Scripting, csi.
+                (call-with-output-file "bootstrap-scripting-ivt.cs"
+                  (lambda (port)
+                    (display "using System.Runtime.CompilerServices;
+[assembly: InternalsVisibleTo(\"Microsoft.CodeAnalysis.CSharp.Scripting\")]
+[assembly: InternalsVisibleTo(\"csi\")]
+" port)))
+                ;; .resources from .resx for all assemblies.
+                (invoke "resgen"
+                        
"src/Compilers/Core/Portable/CodeAnalysisResources.resx"
+                        
"Microsoft.CodeAnalysis.CodeAnalysisResources.resources")
+                (invoke "resgen"
+                        "src/Compilers/CSharp/Portable/CSharpResources.resx"
+                        
"Microsoft.CodeAnalysis.CSharp.CSharpResources.resources")
+                ;; CSharpResources.Designer.cs for string constants.
+                (invoke "resx2sr" "-o"
+                        
"src/Compilers/CSharp/Portable/CSharpResources.Designer.cs"
+                        "-n" "Microsoft.CodeAnalysis.CSharp.CSharpResources"
+                        "src/Compilers/CSharp/Portable/CSharpResources.resx")
+                ;; ScriptingResources.Designer.cs.
+                (invoke "resx2sr" "-o"
+                        "src/Scripting/Core/ScriptingResources.Designer.cs"
+                        "-n" 
"Microsoft.CodeAnalysis.Scripting.ScriptingResources"
+                        "src/Scripting/Core/ScriptingResources.resx")
+                ;; CSharpScriptingResources.Designer.cs.
+                (invoke "resx2sr" "-o"
+                        
"src/Scripting/CSharp/CSharpScriptingResources.Designer.cs"
+                        "-n" 
"Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScriptingResources"
+                        "src/Scripting/CSharp/CSharpScriptingResources.resx")))
+
+            ;; Build CSharpSyntaxGenerator from source and regenerate
+            ;; the three Syntax.xml.*.Generated.cs files.  The generator
+            ;; reads Syntax.xml and produces C# 8 compatible output
+            ;; (patched SourceWriter.cs emits casts for switch expressions
+            ;; and removes TResult?/where TResult : default).
+            (add-before 'compile 'generate-source
+              (lambda* (#:key inputs #:allow-other-keys)
+                (mkdir-p "generated")
+                ;; Delete checked-in generated files; we regenerate them
+                ;; with C# 8 compatible output from patched generators.
+                (for-each delete-file
+                          (find-files "src/Compilers/CSharp/Portable/Generated"
+                                     "\\.cs$"))
+                ;; CSharpSyntaxGenerator needs 4 source files from the
+                ;; compiler tree (enum/constant definitions only).
+                ;; -d:NETCOREAPP is harmless here (no code gated on it
+                ;; in 3.8) but needed by 3.9 where the CLI entry point
+                ;; moved behind #if NETCOREAPP.  Passing it here lets
+                ;; 3.9 inherit this phase unchanged.
+                (apply invoke "csc" "@csc.rsp" "-d:NETCOREAPP"
+                       "-out:generated/CSharpSyntaxGenerator.exe"
+                       "-r:System.dll" "-r:System.Core.dll"
+                       "-r:System.Xml.dll" "-r:System.Xml.Linq.dll"
+                       (string-append
+                        "-r:" (search-input-file
+                               inputs
+                               
"/lib/mono/4.5/System.Collections.Immutable.dll"))
+                       (append
+                        (find-files
+                         
"src/Tools/Source/CompilerGeneratorTools/Source/CSharpSyntaxGenerator"
+                         "\\.cs$")
+                        (list
+                         "src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs"
+                         
"src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs"
+                         
"src/Compilers/CSharp/Portable/Declarations/DeclarationModifiers.cs"
+                         
"src/Compilers/Core/Portable/Symbols/WellKnownMemberNames.cs")))
+                (invoke "mono" "generated/CSharpSyntaxGenerator.exe"
+                        "src/Compilers/CSharp/Portable/Syntax/Syntax.xml"
+                        "generated/")
+                ;; BoundTreeGenerator.
+                (apply invoke "csc" "@csc.rsp"
+                       "-out:generated/BoundTreeGenerator.exe"
+                       "-r:System.dll" "-r:System.Core.dll"
+                       "-r:System.Xml.dll" "-r:System.Xml.Linq.dll"
+                       (find-files
+                        
"src/Tools/Source/CompilerGeneratorTools/Source/BoundTreeGenerator"
+                        "\\.cs$"))
+                (invoke "mono" "generated/BoundTreeGenerator.exe" "CSharp"
+                        
"src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml"
+                        "generated/BoundNodes.xml.Generated.cs")
+                ;; CSharpErrorFactsGenerator.
+                (apply invoke "csc" "@csc.rsp"
+                       "-out:generated/CSharpErrorFactsGenerator.exe"
+                       "-r:System.dll" "-r:System.Core.dll"
+                       (find-files
+                        
"src/Tools/Source/CompilerGeneratorTools/Source/CSharpErrorFactsGenerator"
+                        "\\.cs$"))
+                (invoke "mono" "generated/CSharpErrorFactsGenerator.exe"
+                        "src/Compilers/CSharp/Portable/Errors/ErrorCode.cs"
+                        "generated/ErrorFacts.Generated.cs")
+                ;; CoreAssemblyLoaderImpl stub: the real implementation
+                ;; uses .NET Core's AssemblyLoadContext; on Mono the
+                ;; Desktop loader is used instead.
+                (call-with-output-file "CoreAssemblyLoaderImpl_stub.cs"
+                  (lambda (port)
+                    (display
+"namespace Microsoft.CodeAnalysis.Scripting.Hosting {
+    internal sealed class CoreAssemblyLoaderImpl : AssemblyLoaderImpl {
+        internal CoreAssemblyLoaderImpl(InteractiveAssemblyLoader loader) : 
base(loader)
+        { throw new System.PlatformNotSupportedException(); }
+        public override System.Reflection.Assembly 
LoadFromStream(System.IO.Stream peStream, System.IO.Stream pdbStream)
+        { throw new System.PlatformNotSupportedException(); }
+        public override AssemblyAndLocation LoadFromPath(string 
assemblyFilePath)
+        { throw new System.PlatformNotSupportedException(); }
+        public override void Dispose() { }
+    }
+}
+" port)))))
+
+            ;; Compile all assemblies: Core, CSharp, Scripting,
+            ;; CSharp.Scripting, and csc.exe.
+            (replace 'compile
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let* ((sci-dll
+                        (search-input-file
+                         inputs 
"/lib/mono/4.5/System.Collections.Immutable.dll"))
+                       (srm-dir
+                        (if (file-exists? "srm-src-patched")
+                            "srm-src-patched"
+                            #$%srm-source-dir))
+                       (srm-source-files
+                        (filter
+                         (lambda (f)
+                           (not (or (string-contains f "netstandard")
+                                    (string-contains f "netcoreapp")
+                                    (string-contains f "AssemblyInfo")
+                                    (string-suffix? "/SR.cs" f))))
+                         (find-files srm-dir "\\.cs$")))
+                       (deps-dir
+                        (if (file-exists? 
"src/Dependencies/CodeAnalysis.Metadata")
+                            "src/Dependencies/CodeAnalysis.Metadata"
+                            "src/Dependencies/CodeAnalysis.Debugging")))
+
+                  ;; 1. Microsoft.CodeAnalysis.dll (Core)
+                  (apply invoke "csc" "@csc.rsp" "-target:library" "-unsafe"
+                         "-out:Microsoft.CodeAnalysis.dll"
+                         (string-append
+                          
"-resource:Microsoft.CodeAnalysis.CodeAnalysisResources.resources"
+                          
",Microsoft.CodeAnalysis.CodeAnalysisResources.resources")
+                         "-r:System.dll" "-r:System.Core.dll"
+                         "-r:System.Xml.dll" "-r:System.Xml.Linq.dll"
+                         "-r:System.Numerics.dll" 
"-r:System.IO.Compression.dll"
+                         "-r:System.Security.dll"
+                         "-r:System.Runtime.Serialization.dll"
+                         (string-append "-r:" sci-dll)
+                         "-d:COMPILERCORE" "-d:SRM"
+                         "srm-strings.cs" "srm-strings-format.cs"
+                         "bootstrap-sr.cs" "bootstrap-resourcemanager.cs"
+                         "bootstrap-ivt.cs"
+                         "src/Compilers/Shared/CoreClrShim.cs"
+                         "src/Compilers/Shared/DesktopShim.cs"
+                         (append
+                          (find-files "src/Compilers/Core/Portable" "\\.cs$")
+                          (find-files "src/Compilers/Core/AnalyzerDriver" 
"\\.cs$")
+                          (find-files deps-dir "\\.cs$")
+                          (find-files "src/Dependencies/PooledObjects" 
"\\.cs$")
+                          srm-source-files))
+
+                  ;; 2. Microsoft.CodeAnalysis.CSharp.dll
+                  (apply invoke "csc" "@csc.rsp" "-target:library" "-unsafe"
+                         "-out:Microsoft.CodeAnalysis.CSharp.dll"
+                         (string-append
+                          
"-resource:Microsoft.CodeAnalysis.CSharp.CSharpResources.resources"
+                          
",Microsoft.CodeAnalysis.CSharp.CSharpResources.resources")
+                         "-r:System.dll" "-r:System.Core.dll"
+                         "-r:System.Xml.dll" "-r:System.Xml.Linq.dll"
+                         "-r:System.Numerics.dll" 
"-r:System.IO.Compression.dll"
+                         (string-append "-r:" sci-dll)
+                         "-r:Microsoft.CodeAnalysis.dll"
+                         "bootstrap-csharp-ivt.cs"
+                         
"src/Compilers/CSharp/CSharpAnalyzerDriver/CSharpDeclarationComputer.cs"
+                         (append
+                          (find-files "src/Compilers/CSharp/Portable" "\\.cs$")
+                          (if (file-exists? "generated")
+                              (find-files "generated" "\\.cs$")
+                              '())))
+
+                  ;; 3. Microsoft.CodeAnalysis.Scripting.dll
+                  (apply invoke "csc" "@csc.rsp" "-target:library" "-unsafe"
+                         "-d:SCRIPTING"
+                         "-out:Microsoft.CodeAnalysis.Scripting.dll"
+                         "-r:System.dll" "-r:System.Core.dll"
+                         "-r:System.Runtime.Serialization.dll"
+                         (string-append "-r:" sci-dll)
+                         "-r:Microsoft.CodeAnalysis.dll"
+                         "bootstrap-scripting-ivt.cs"
+                         "CoreAssemblyLoaderImpl_stub.cs"
+                         (append
+                          (filter
+                           ;; Exclude .NET Core-only assembly loader.
+                           (lambda (f)
+                             (not (string-suffix? "CoreAssemblyLoaderImpl.cs" 
f)))
+                           (find-files "src/Scripting/Core" "\\.cs$"))
+                          (find-files
+                           "src/Compilers/Shared/GlobalAssemblyCacheHelpers"
+                           "\\.cs$")))
+
+                  ;; 4. Microsoft.CodeAnalysis.CSharp.Scripting.dll
+                  (apply invoke "csc" "@csc.rsp" "-target:library"
+                         "-out:Microsoft.CodeAnalysis.CSharp.Scripting.dll"
+                         "-r:System.dll" "-r:System.Core.dll"
+                         (string-append "-r:" sci-dll)
+                         "-r:Microsoft.CodeAnalysis.dll"
+                         "-r:Microsoft.CodeAnalysis.CSharp.dll"
+                         "-r:Microsoft.CodeAnalysis.Scripting.dll"
+                         (find-files "src/Scripting/CSharp" "\\.cs$"))
+
+                  ;; 5. csc.exe
+                  (invoke "csc" "@csc.rsp" "-out:csc.exe"
+                          "-r:System.dll" "-r:System.Core.dll"
+                          (string-append "-r:" sci-dll)
+                          "-r:Microsoft.CodeAnalysis.dll"
+                          "-r:Microsoft.CodeAnalysis.CSharp.dll"
+                          "src/Compilers/CSharp/csc/Program.cs"
+                          "src/Compilers/Shared/Csc.cs"
+                          "src/Compilers/Shared/BuildClient.cs"
+                          "src/Compilers/Shared/BuildServerConnection.cs"
+                          "src/Compilers/Shared/DesktopBuildClient.cs"
+                          
"src/Compilers/Shared/DesktopAnalyzerAssemblyLoader.cs"
+                          "src/Compilers/Shared/ExitingTraceListener.cs"
+                          "src/Compilers/Shared/CoreClrShim.cs"
+                          "src/Compilers/Shared/DesktopShim.cs"
+                          "src/Compilers/Shared/NamedPipeUtil.cs"
+                          "src/Compilers/Shared/RuntimeHostInfo.cs"
+                          "src/Compilers/Core/CommandLine/BuildProtocol.cs"
+                          "src/Compilers/Core/CommandLine/NativeMethods.cs"
+                          "src/Compilers/Core/CommandLine/ConsoleUtil.cs"
+                          
"src/Compilers/Core/CommandLine/CompilerServerLogger.cs"))))
+
+            ;; Install all assemblies.
+            (replace 'install
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let* ((out (assoc-ref outputs "out"))
+                       (lib (string-append out "/lib/roslyn"))
+                       (bin (string-append out "/bin"))
+                       (sci-dll (search-input-file
+                                 inputs
+                                 
"/lib/mono/4.5/System.Collections.Immutable.dll")))
+                  (mkdir-p lib)
+                  (mkdir-p bin)
+                  (for-each
+                   (lambda (f) (install-file f lib))
+                   '("csc.exe"
+                     "Microsoft.CodeAnalysis.dll"
+                     "Microsoft.CodeAnalysis.CSharp.dll"
+                     "Microsoft.CodeAnalysis.Scripting.dll"
+                     "Microsoft.CodeAnalysis.CSharp.Scripting.dll"))
+                  (symlink sci-dll
+                           (string-append lib 
"/System.Collections.Immutable.dll"))
+                  (call-with-output-file (string-append bin "/csc")
+                    (lambda (port)
+                      (format port "#!~a~%exec mono ~a/csc.exe \"$@\"~%"
+                              (search-input-file inputs "/bin/bash") lib)))
+                  (chmod (string-append bin "/csc") #o755))))))))
+    (synopsis "C# 9.0 compiler and scripting libraries, bootstrapped from 
source")
+    (description
+     "This package provides the Roslyn C# compiler (@command{csc}) and
+scripting libraries, built from source using @code{roslyn-3.2} as the
+bootstrap compiler.  It produces a C# 9.0 compiler matching Mono 6.12.")))
+
+(define roslyn roslyn-3.8)
+
 ;; too new version: 15.9.21.664
 ;; too old (no support for mono) version: 14.0
 (define-public msbuild
diff --git a/gnu/packages/patches/roslyn-3.8.0-bootstrap-with-csc-3.2.patch 
b/gnu/packages/patches/roslyn-3.8.0-bootstrap-with-csc-3.2.patch
new file mode 100644
index 0000000000..9c11c91922
--- /dev/null
+++ b/gnu/packages/patches/roslyn-3.8.0-bootstrap-with-csc-3.2.patch
@@ -0,0 +1,1366 @@
+Author: Danny Milosavljevic <[email protected]>
+Date: 2026-04-08
+Subject: Downgrade C# 9 syntax to C# 8.
+
+Downgrade C# 9 syntax to C# 8 (is-not-null, or/and patterns, static
+lambdas, target-typed new, index operator, unconstrained T?).
+Patch CSharpSyntaxGenerator templates to emit C# 8 compatible generated code.
+
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- roslyn-3.8-clean/src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs  
2026-04-10 00:08:17.363689190 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs     
   2026-04-10 02:52:52.308934599 +0000
+@@ -1354,13 +1354,13 @@
+                         {
+                             var int32Value = valueLeft.Int32Value << 
valueRight.Int32Value;
+                             var int64Value = valueLeft.Int64Value << 
valueRight.Int32Value;
+-                            return (int32Value == int64Value) ? int32Value : 
null;
++                            return (int32Value == int64Value) ? 
(object)int32Value : null;
+                         }
+                     case BinaryOperatorKind.NUIntLeftShift:
+                         {
+                             var uint32Value = valueLeft.UInt32Value << 
valueRight.Int32Value;
+                             var uint64Value = valueLeft.UInt64Value << 
valueRight.Int32Value;
+-                            return (uint32Value == uint64Value) ? uint32Value 
: null;
++                            return (uint32Value == uint64Value) ? 
(object)uint32Value : null;
+                         }
+                 }
+ 
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs
   2026-04-10 00:08:17.371692276 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs
 2026-04-10 02:52:52.309580449 +0000
+@@ -440,7 +440,7 @@
+             }
+ 
+             
Debug.Assert(!expectedConvention.CallKind.HasUnknownCallingConventionAttributeBits());
+-            Debug.Assert(expectedConvention.UnmanagedCallingConventionTypes 
is not null);
++            Debug.Assert(expectedConvention.UnmanagedCallingConventionTypes 
!= null);
+             
Debug.Assert(expectedConvention.UnmanagedCallingConventionTypes.IsEmpty || 
expectedConvention.CallKind == Cci.CallingConvention.Unmanaged);
+ 
+             Debug.Assert(!_binder.IsEarlyAttributeBinder);
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/BoundTree/NullabilityRewriter.cs 
   2026-04-10 00:08:17.373331829 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/BoundTree/NullabilityRewriter.cs
  2026-04-10 02:52:52.309994114 +0000
+@@ -54,13 +54,18 @@
+                 var right = (BoundExpression)Visit(currentBinary.Right);
+                 var type = foundInfo ? infoAndType.Type : currentBinary.Type;
+ 
+-                currentBinary = currentBinary switch
++                switch (currentBinary)
+                 {
+-                    BoundBinaryOperator binary => 
binary.Update(binary.OperatorKind, binary.ConstantValueOpt, 
GetUpdatedSymbol(binary, binary.MethodOpt), binary.ResultKind, 
binary.OriginalUserDefinedOperatorsOpt, leftChild, right, type!),
++                    case BoundBinaryOperator binary:
++                        currentBinary = binary.Update(binary.OperatorKind, 
binary.ConstantValueOpt, GetUpdatedSymbol(binary, binary.MethodOpt), 
binary.ResultKind, binary.OriginalUserDefinedOperatorsOpt, leftChild, right, 
type!);
++                        break;
+                     // https://github.com/dotnet/roslyn/issues/35031: We'll 
need to update logical.LogicalOperator
+-                    BoundUserDefinedConditionalLogicalOperator logical => 
logical.Update(logical.OperatorKind, logical.LogicalOperator, 
logical.TrueOperator, logical.FalseOperator, logical.ResultKind, 
logical.OriginalUserDefinedOperatorsOpt, leftChild, right, type!),
+-                    _ => throw 
ExceptionUtilities.UnexpectedValue(currentBinary.Kind),
+-                };
++                    case BoundUserDefinedConditionalLogicalOperator logical:
++                        currentBinary = logical.Update(logical.OperatorKind, 
logical.LogicalOperator, logical.TrueOperator, logical.FalseOperator, 
logical.ResultKind, logical.OriginalUserDefinedOperatorsOpt, leftChild, right, 
type!);
++                        break;
++                    default:
++                        throw 
ExceptionUtilities.UnexpectedValue(currentBinary.Kind);
++                }
+ 
+                 if (foundInfo)
+                 {
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs 
   2026-04-10 00:08:17.377739511 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs
  2026-04-10 02:52:52.310254011 +0000
+@@ -2183,7 +2183,7 @@
+ 
+         private BinderFactory GetBinderFactory(SyntaxTree syntaxTree, bool 
ignoreAccessibility, ref WeakReference<BinderFactory>[]? cachedBinderFactories)
+         {
+-            Debug.Assert(System.Runtime.CompilerServices.Unsafe.AreSame(ref 
cachedBinderFactories, ref ignoreAccessibility ? ref 
_ignoreAccessibilityBinderFactories : ref _binderFactories));
++            // Debug.Assert for ref-equality check removed: Unsafe.AreSame 
not available on Mono
+ 
+             var treeNum = GetSyntaxTreeOrdinal(syntaxTree);
+             WeakReference<BinderFactory>[]? binderFactories = 
cachedBinderFactories;
+@@ -3372,7 +3372,7 @@
+                 throw new 
ArgumentException(CSharpResources.OutIsNotValidForReturn);
+             }
+ 
+-            if (callingConvention != SignatureCallingConvention.Unmanaged && 
!callingConventionTypes.IsDefaultOrEmpty)
++            if (callingConvention != (SignatureCallingConvention)9 && 
!callingConventionTypes.IsDefaultOrEmpty)
+             {
+                 throw new 
ArgumentException(string.Format(CSharpResources.CallingConventionTypesRequireUnmanaged,
 nameof(callingConventionTypes), nameof(callingConvention)));
+             }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Compilation/CSharpSemanticModel.cs
  2026-04-10 00:08:17.377739511 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Compilation/CSharpSemanticModel.cs
        2026-04-10 02:52:52.310803922 +0000
+@@ -2231,7 +2231,7 @@
+ 
+             return CSharpTypeInfo.None;
+ 
+-            static (TypeSymbol, NullabilityInfo) 
getTypeAndNullability(BoundExpression expr) => (expr.Type, 
expr.TopLevelNullability);
++            (TypeSymbol, NullabilityInfo) 
getTypeAndNullability(BoundExpression expr) => (expr.Type, 
expr.TopLevelNullability);
+         }
+ 
+         // Gets the method or property group from a specific bound node.
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- roslyn-3.8-clean/src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs  
2026-04-10 00:08:17.380448579 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs     
   2026-04-10 02:52:52.311281156 +0000
+@@ -599,7 +599,7 @@
+             if (!hasStaticConstructor &&
+                 
processedStaticInitializers.BoundInitializers.IsDefaultOrEmpty &&
+                 _compilation.LanguageVersion >= 
MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion() &&
+-                containingType is { IsImplicitlyDeclared: false, TypeKind: 
TypeKind.Class or TypeKind.Struct or TypeKind.Interface })
++                containingType is { IsImplicitlyDeclared: false } && 
(containingType.TypeKind == TypeKind.Class || containingType.TypeKind == 
TypeKind.Struct || containingType.TypeKind == TypeKind.Interface))
+             {
+                 NullableWalker.AnalyzeIfNeeded(
+                     this._compilation,
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs   
   2026-04-10 00:08:17.385284232 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs 
   2026-04-10 02:52:52.312107153 +0000
+@@ -753,7 +753,7 @@
+                                 var memberToInitialize = member;
+                                 switch (member)
+                                 {
+-                                    case PropertySymbol:
++                                    case PropertySymbol _:
+                                         // skip any manually implemented 
properties.
+                                         continue;
+                                     case FieldSymbol { IsConst: true }:
+@@ -965,7 +965,7 @@
+             foreach (var inputParam in parameters)
+             {
+                 if (inputParamNames.Contains(inputParam.Name)
+-                    && GetOrCreateSlot(inputParam) is > 0 and int inputSlot
++                    && GetOrCreateSlot(inputParam) is int inputSlot && 
inputSlot > 0
+                     && state[inputSlot].IsNotNull())
+                 {
+                     var location = syntaxOpt?.GetLocation() ?? 
methodMainNode.Syntax.GetLastToken().GetLocation();
+@@ -4736,7 +4736,7 @@
+             }
+ 
+             var argsToParamsOpt = compareExchangeInfo.ArgsToParamsOpt;
+-            Debug.Assert(argsToParamsOpt is { IsDefault: true } or { Length: 
3 });
++            Debug.Assert(argsToParamsOpt is { IsDefault: true } || 
argsToParamsOpt is { Length: 3 });
+             var (comparandIndex, valueIndex, locationIndex) = 
argsToParamsOpt.IsDefault
+                 ? (2, 1, 0)
+                 : (argsToParamsOpt.IndexOf(2), argsToParamsOpt.IndexOf(1), 
argsToParamsOpt.IndexOf(0));
+@@ -6169,7 +6169,7 @@
+             Debug.Assert(false); // If this assert fails, add an appropriate 
test.
+             return symbol;
+ 
+-            bool tryAsMemberOfSingleType(NamedTypeSymbol singleType, 
[NotNullWhen(true)] out Symbol? result)
++            bool tryAsMemberOfSingleType(NamedTypeSymbol singleType, out 
Symbol? result)
+             {
+                 if (!singleType.Equals(symbolContainer, 
TypeCompareKind.AllIgnoreOptions))
+                 {
+@@ -9180,7 +9180,7 @@
+             VisitRvalue(node.Argument);
+             // https://github.com/dotnet/roslyn/issues/31018: Check for 
delegate mismatch.
+             if (node.Argument.ConstantValue?.IsNull != true
+-                && MakeMemberSlot(receiverOpt, @event) is > 0 and var 
memberSlot)
++                && MakeMemberSlot(receiverOpt, @event) is var memberSlot && 
memberSlot > 0)
+             {
+                 this.State[memberSlot] = node.IsAddition
+                     ? this.State[memberSlot].Meet(ResultType.State)
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker_Patterns.cs
     2026-04-10 00:08:17.385284232 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker_Patterns.cs
   2026-04-10 02:52:52.312792848 +0000
+@@ -638,7 +638,7 @@
+             var inferredTypeWithAnnotations = 
TypeWithAnnotations.Create(inferredType);
+ 
+             // Convert elements to best type to determine element top-level 
nullability and to report nested nullability warnings
+-            if (inferredType is not null)
++            if (inferredType is object)
+             {
+                 for (int i = 0; i < numSwitchArms; i++)
+                 {
+@@ -651,7 +651,7 @@
+             var inferredState = 
BestTypeInferrer.GetNullableState(resultTypes);
+             var resultType = TypeWithState.Create(inferredType, 
inferredState);
+ 
+-            if (inferredType is not null)
++            if (inferredType is object)
+             {
+                 inferredTypeWithAnnotations = 
resultType.ToTypeWithAnnotations(compilation);
+                 if (resultType.State == NullableFlowState.MaybeDefault)
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs
  2026-04-10 00:08:17.400434771 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs
        2026-04-10 02:52:52.312948951 +0000
+@@ -336,7 +336,7 @@
+             // Step three: Now fill in the optional arguments. (Dev11 uses 
the getter for optional arguments in
+             // compound assignments, but for deconstructions we use the 
setter if the getter is missing.)
+             var accessor = indexer.GetOwnOrInheritedGetMethod() ?? 
indexer.GetOwnOrInheritedSetMethod();
+-            Debug.Assert(accessor is not null);
++            Debug.Assert(accessor != null);
+             InsertMissingOptionalArguments(syntax, accessor.Parameters, 
actualArguments, refKinds);
+ 
+             // For a call, step four would be to optimize away some of the 
temps.  However, we need them all to prevent
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_IndexerAccess.cs
       2026-04-10 00:08:17.400434771 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_IndexerAccess.cs
     2026-04-10 02:52:52.313080297 +0000
+@@ -127,7 +127,7 @@
+             else
+             {
+                 var getMethod = indexer.GetOwnOrInheritedGetMethod();
+-                Debug.Assert(getMethod is not null);
++                Debug.Assert(getMethod != null);
+ 
+                 // We have already lowered each argument, but we may need 
some additional rewriting for the arguments,
+                 // such as generating a params array, re-ordering arguments 
based on argsToParamsOpt map, inserting arguments for optional parameters, etc.
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs
        2026-04-10 00:08:17.405137886 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs
      2026-04-10 02:52:52.313195282 +0000
+@@ -217,7 +217,7 @@
+                     {
+                         var boundObjectInitializerMember = 
(BoundObjectInitializerMember)containingExpression;
+                         var property = 
(PropertySymbol?)boundObjectInitializerMember.MemberSymbol;
+-                        Debug.Assert(property is not null);
++                        Debug.Assert(property != null);
+                         MethodSymbol? accessor = 
isObjectOrCollectionInitializer ? property.GetOwnOrInheritedGetMethod() : 
property.GetOwnOrInheritedSetMethod();
+                         return DeriveArguments(
+                                     boundObjectInitializerMember,
+@@ -335,7 +335,7 @@
+                 return ImmutableArray<IArgumentOperation>.Empty;
+             }
+ 
+-            Debug.Assert(optionalParametersMethod is not null);
++            Debug.Assert(optionalParametersMethod != null);
+ 
+             return LocalRewriter.MakeArgumentsInEvaluationOrder(
+                  operationFactory: this,
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- roslyn-3.8-clean/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs    
2026-04-10 00:08:17.405450612 +0000
++++ roslyn-3.8-patched/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs  
2026-04-10 02:52:52.314101741 +0000
+@@ -10627,11 +10627,10 @@
+                 {
+                     tk = this.PeekToken(i).Kind;
+                 }
+-                return tk
+-                    is SyntaxKind.OpenParenToken
+-                    or SyntaxKind.OpenBracketToken
+-                    or SyntaxKind.DotToken
+-                    or SyntaxKind.QuestionToken;
++                return tk == SyntaxKind.OpenParenToken
++                    || tk == SyntaxKind.OpenBracketToken
++                    || tk == SyntaxKind.DotToken
++                    || tk == SyntaxKind.QuestionToken;
+             }
+         }
+ 
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Parser/LanguageParser_Patterns.cs
   2026-04-10 00:08:17.405450612 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Parser/LanguageParser_Patterns.cs
 2026-04-10 02:52:52.314937557 +0000
+@@ -39,10 +39,10 @@
+             var pattern = 
ParsePattern(GetPrecedence(SyntaxKind.IsPatternExpression), afterIs: true);
+             return pattern switch
+             {
+-                ConstantPatternSyntax cp when 
ConvertExpressionToType(cp.Expression, out NameSyntax type) => type,
+-                TypePatternSyntax tp => tp.Type,
+-                DiscardPatternSyntax dp => 
_syntaxFactory.IdentifierName(ConvertToIdentifier(dp.UnderscoreToken)),
+-                var p => p,
++                ConstantPatternSyntax cp when 
ConvertExpressionToType(cp.Expression, out NameSyntax type) => 
(CSharpSyntaxNode)type,
++                TypePatternSyntax tp => (CSharpSyntaxNode)tp.Type,
++                DiscardPatternSyntax dp => 
(CSharpSyntaxNode)_syntaxFactory.IdentifierName(ConvertToIdentifier(dp.UnderscoreToken)),
++                var p => (CSharpSyntaxNode)p,
+             };
+         }
+ 
+@@ -455,10 +455,10 @@
+             var pattern = ParsePattern(Precedence.Conditional, whenIsKeyword: 
true);
+             return pattern switch
+             {
+-                ConstantPatternSyntax cp => cp.Expression,
+-                TypePatternSyntax tp when ConvertTypeToExpression(tp.Type, 
out ExpressionSyntax expr) => expr,
+-                DiscardPatternSyntax dp => 
_syntaxFactory.IdentifierName(ConvertToIdentifier(dp.UnderscoreToken)),
+-                var p => p,
++                ConstantPatternSyntax cp => (CSharpSyntaxNode)cp.Expression,
++                TypePatternSyntax tp when ConvertTypeToExpression(tp.Type, 
out ExpressionSyntax expr) => (CSharpSyntaxNode)expr,
++                DiscardPatternSyntax dp => 
(CSharpSyntaxNode)_syntaxFactory.IdentifierName(ConvertToIdentifier(dp.UnderscoreToken)),
++                var p => (CSharpSyntaxNode)p,
+             };
+         }
+ 
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor.Members.cs
       2026-04-10 00:08:17.411756432 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/SymbolDisplay/SymbolDisplayVisitor.Members.cs
     2026-04-10 02:52:52.315077990 +0000
+@@ -560,7 +560,7 @@
+ 
+                     var conventionTypes = 
symbol.UnmanagedCallingConventionTypes;
+ 
+-                    if (symbol.CallingConvention != 
SignatureCallingConvention.Unmanaged || !conventionTypes.IsEmpty)
++                    if (symbol.CallingConvention != 
(SignatureCallingConvention)9 || !conventionTypes.IsEmpty)
+                     {
+                         AddPunctuation(SyntaxKind.OpenBracketToken);
+ 
+@@ -579,7 +579,7 @@
+                                 
builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, symbol, "Fastcall"));
+                                 break;
+ 
+-                            case SignatureCallingConvention.Unmanaged:
++                            case (SignatureCallingConvention)9:
+                                 
Debug.Assert(!conventionTypes.IsDefaultOrEmpty);
+                                 bool isFirst = true;
+                                 foreach (var conventionType in 
conventionTypes)
+@@ -593,7 +593,7 @@
+                                     isFirst = false;
+                                     
Debug.Assert(conventionType.Name.StartsWith("CallConv"));
+                                     const int CallConvLength = 8;
+-                                    
builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, conventionType, 
conventionType.Name[CallConvLength..]));
++                                    
builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, conventionType, 
conventionType.Name.Substring(CallConvLength)));
+                                 }
+ 
+                                 break;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs
       2026-04-10 00:08:17.415170982 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/FunctionPointers/FunctionPointerTypeSymbol.cs
     2026-04-10 02:52:52.315373944 +0000
+@@ -206,7 +206,7 @@
+         /// </summary>
+         internal static bool IsCallingConventionModifier(NamedTypeSymbol 
modifierType)
+         {
+-            Debug.Assert(modifierType.ContainingAssembly is not null || 
modifierType.IsErrorType());
++            Debug.Assert(modifierType.ContainingAssembly != null || 
modifierType.IsErrorType());
+             return (object?)modifierType.ContainingAssembly == 
modifierType.ContainingAssembly?.CorLibrary
+                    && modifierType.Arity == 0
+                    && modifierType.Name != "CallConv"
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEMethodSymbol.cs
       2026-04-10 00:08:17.415735200 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEMethodSymbol.cs
     2026-04-10 02:52:52.315517133 +0000
+@@ -1439,7 +1439,7 @@
+             {
+                 var containingModule = (PEModuleSymbol)ContainingModule;
+                 var unmanagedCallersOnlyData = 
containingModule.Module.TryGetUnmanagedCallersOnlyAttribute(_handle, new 
MetadataDecoder(containingModule),
+-                    static (name, value, isField) => 
MethodSymbol.TryDecodeUnmanagedCallersOnlyCallConvsField(name, value, isField, 
location: null, diagnostics: null));
++                    (name, value, isField) => 
MethodSymbol.TryDecodeUnmanagedCallersOnlyCallConvsField(name, value, isField, 
location: null, diagnostics: null));
+ 
+                 Debug.Assert(!ReferenceEquals(unmanagedCallersOnlyData, 
UnmanagedCallersOnlyAttributeData.Uninitialized)
+                              && !ReferenceEquals(unmanagedCallersOnlyData, 
UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound));
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/MethodSymbol.cs     
2026-04-10 00:08:17.415735200 +0000
++++ roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/MethodSymbol.cs   
2026-04-10 02:52:52.315693734 +0000
+@@ -1010,7 +1010,7 @@
+         {
+             Debug.Assert((location == null) == (diagnostics == null));
+ 
+-            if (!IsStatic || MethodKind is not (MethodKind.Ordinary or 
MethodKind.LocalFunction))
++            if (!IsStatic || (MethodKind != MethodKind.Ordinary && MethodKind 
!= MethodKind.LocalFunction))
+             {
+                 // `UnmanagedCallersOnly` can only be applied to ordinary 
static methods or local functions.
+                 
diagnostics?.Add(ErrorCode.ERR_UnmanagedCallersOnlyRequiresStatic, location);
+@@ -1025,7 +1025,7 @@
+ 
+             return false;
+ 
+-            static bool isGenericMethod([DisallowNull] MethodSymbol? method)
++            static bool isGenericMethod(MethodSymbol? method)
+             {
+                 do
+                 {
+@@ -1035,7 +1035,7 @@
+                     }
+ 
+                     method = method.ContainingSymbol as MethodSymbol;
+-                } while (method is not null);
++                } while (method != null);
+ 
+                 return false;
+             }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/OverriddenOrHiddenMembersHelpers.cs
 2026-04-10 00:08:17.415735200 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/OverriddenOrHiddenMembersHelpers.cs
       2026-04-10 02:52:52.315860175 +0000
+@@ -148,10 +148,10 @@
+             // matching is not sufficient. This member is treated as being as 
good as an exact match.
+             Symbol knownOverriddenMember = member switch
+             {
+-                MethodSymbol method => KnownOverriddenClassMethod(method),
+-                PEPropertySymbol { GetMethod: PEMethodSymbol { 
ExplicitlyOverriddenClassMethod: { AssociatedSymbol: PropertySymbol 
overriddenProperty } } } => overriddenProperty,
+-                RetargetingPropertySymbol { GetMethod: 
RetargetingMethodSymbol { ExplicitlyOverriddenClassMethod: { AssociatedSymbol: 
PropertySymbol overriddenProperty } } } => overriddenProperty,
+-                _ => null
++                MethodSymbol method => 
(Symbol)KnownOverriddenClassMethod(method),
++                PEPropertySymbol { GetMethod: PEMethodSymbol { 
ExplicitlyOverriddenClassMethod: { AssociatedSymbol: PropertySymbol 
overriddenProperty } } } => (Symbol)overriddenProperty,
++                RetargetingPropertySymbol { GetMethod: 
RetargetingMethodSymbol { ExplicitlyOverriddenClassMethod: { AssociatedSymbol: 
PropertySymbol overriddenProperty } } } => (Symbol)overriddenProperty,
++                _ => (Symbol)null
+             };
+ 
+             for (NamedTypeSymbol currType = 
containingType.BaseTypeNoUseSiteDiagnostics;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/PublicModel/AliasSymbol.cs
  2026-04-10 00:08:17.415735200 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/PublicModel/AliasSymbol.cs
        2026-04-10 02:52:52.316002773 +0000
+@@ -35,8 +35,8 @@
+             visitor.VisitAlias(this);
+         }
+ 
+-        protected override TResult? Accept<TResult>(SymbolVisitor<TResult> 
visitor)
+-            where TResult : default
++        protected override TResult Accept<TResult>(SymbolVisitor<TResult> 
visitor)
++           
+         {
+             return visitor.VisitAlias(this);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/PublicModel/ArrayTypeSymbol.cs
      2026-04-10 00:08:17.418856711 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/PublicModel/ArrayTypeSymbol.cs
    2026-04-10 02:52:52.316070700 +0000
+@@ -77,8 +77,8 @@
+             visitor.VisitArrayType(this);
+         }
+ 
+-        protected override TResult? Accept<TResult>(SymbolVisitor<TResult> 
visitor)
+-            where TResult : default
++        protected override TResult Accept<TResult>(SymbolVisitor<TResult> 
visitor)
++           
+         {
+             return visitor.VisitArrayType(this);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/PublicModel/DiscardSymbol.cs
        2026-04-10 00:08:17.418856711 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/PublicModel/DiscardSymbol.cs
      2026-04-10 02:52:52.316137004 +0000
+@@ -38,6 +38,6 @@
+         CodeAnalysis.NullableAnnotation IDiscardSymbol.NullableAnnotation => 
_underlying.TypeWithAnnotations.ToPublicAnnotation();
+ 
+         protected override void Accept(SymbolVisitor visitor) => 
visitor.VisitDiscard(this);
+-        protected override TResult? Accept<TResult>(SymbolVisitor<TResult> 
visitor) where TResult : default => visitor.VisitDiscard(this);
++        protected override TResult Accept<TResult>(SymbolVisitor<TResult> 
visitor) => visitor.VisitDiscard(this);
+     }
+ }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/PublicModel/DynamicTypeSymbol.cs
    2026-04-10 00:08:17.418856711 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/PublicModel/DynamicTypeSymbol.cs
  2026-04-10 02:52:52.316205703 +0000
+@@ -38,8 +38,8 @@
+             visitor.VisitDynamicType(this);
+         }
+ 
+-        protected override TResult? Accept<TResult>(SymbolVisitor<TResult> 
visitor)
+-            where TResult : default
++        protected override TResult Accept<TResult>(SymbolVisitor<TResult> 
visitor)
++           
+         {
+             return visitor.VisitDynamicType(this);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/PublicModel/EventSymbol.cs
  2026-04-10 00:08:17.418856711 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/PublicModel/EventSymbol.cs
        2026-04-10 02:52:52.316272448 +0000
+@@ -97,8 +97,8 @@
+             visitor.VisitEvent(this);
+         }
+ 
+-        protected override TResult? Accept<TResult>(SymbolVisitor<TResult> 
visitor)
+-            where TResult : default
++        protected override TResult Accept<TResult>(SymbolVisitor<TResult> 
visitor)
++           
+         {
+             return visitor.VisitEvent(this);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/PublicModel/FunctionPointerTypeSymbol.cs
    2026-04-10 00:08:17.418856711 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/PublicModel/FunctionPointerTypeSymbol.cs
  2026-04-10 02:52:52.316339183 +0000
+@@ -27,8 +27,8 @@
+         protected override void Accept(SymbolVisitor visitor)
+             => visitor.VisitFunctionPointerType(this);
+ 
+-        protected override TResult? Accept<TResult>(SymbolVisitor<TResult> 
visitor)
+-            where TResult : default
++        protected override TResult Accept<TResult>(SymbolVisitor<TResult> 
visitor)
++           
+         {
+             return visitor.VisitFunctionPointerType(this);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/PublicModel/LabelSymbol.cs
  2026-04-10 00:08:17.418856711 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/PublicModel/LabelSymbol.cs
        2026-04-10 02:52:52.316412310 +0000
+@@ -35,8 +35,8 @@
+             visitor.VisitLabel(this);
+         }
+ 
+-        protected override TResult? Accept<TResult>(SymbolVisitor<TResult> 
visitor)
+-            where TResult : default
++        protected override TResult Accept<TResult>(SymbolVisitor<TResult> 
visitor)
++           
+         {
+             return visitor.VisitLabel(this);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/Source/ParameterHelpers.cs
  2026-04-10 00:08:17.421120344 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/Source/ParameterHelpers.cs
        2026-04-10 02:52:52.316505825 +0000
+@@ -453,7 +453,7 @@
+             }
+             else if (parameter.TypeWithAnnotations.IsStatic)
+             {
+-                Debug.Assert(parameter.ContainingSymbol is 
FunctionPointerMethodSymbol or { ContainingType: not null });
++                Debug.Assert(parameter.ContainingSymbol is 
FunctionPointerMethodSymbol || (parameter.ContainingSymbol is { ContainingType: 
{ } }));
+                 // error CS0721: '{0}': static types cannot be used as 
parameters
+                 diagnostics.Add(
+                     
ErrorFacts.GetStaticClassParameterCode(parameter.ContainingSymbol.ContainingType?.IsInterfaceType()
 ?? false),
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs
       2026-04-10 00:08:17.421120344 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs
     2026-04-10 02:52:52.316775791 +0000
+@@ -425,7 +425,7 @@
+                     {
+                         BaseTypeDeclarationSyntax typeDecl => 
typeDecl.Identifier,
+                         DelegateDeclarationSyntax delegateDecl => 
delegateDecl.Identifier,
+-                        _ => null
++                        _ => (SyntaxToken?)null
+                     };
+ 
+                     ReportTypeNamedRecord(identifier?.Text, 
this.DeclaringCompilation, diagnostics, identifier?.GetLocation() ?? 
Location.None);
+@@ -3062,7 +3062,7 @@
+             var getHashCode = addGetHashCode(equalityContract);
+             addEqualityOperators();
+ 
+-            if (thisEquals is not SynthesizedRecordEquals && getHashCode is 
SynthesizedRecordGetHashCode)
++            if (!(thisEquals is SynthesizedRecordEquals) && getHashCode is 
SynthesizedRecordGetHashCode)
+             {
+                 diagnostics.Add(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, 
thisEquals.Locations[0], declaration.Name);
+             }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol_ImplementationChecks.cs
  2026-04-10 00:08:17.421120344 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol_ImplementationChecks.cs
        2026-04-10 02:52:52.317116619 +0000
+@@ -83,7 +83,7 @@
+             foreach (var abstractMember in this.AbstractMembers)
+             {
+                 // Dev10 reports failure to implement properties/events in 
terms of the accessors
+-                if (abstractMember.Kind == SymbolKind.Method && 
abstractMember is not SynthesizedRecordOrdinaryMethod)
++                if (abstractMember.Kind == SymbolKind.Method && 
!(abstractMember is SynthesizedRecordOrdinaryMethod))
+                 {
+                     
diagnostics.Add(ErrorCode.ERR_UnimplementedAbstractMethod, this.Locations[0], 
this, abstractMember);
+                 }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/Source/SourceMethodSymbolWithAttributes.cs
  2026-04-10 00:08:17.421120344 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/Source/SourceMethodSymbolWithAttributes.cs
        2026-04-10 02:52:52.317321323 +0000
+@@ -442,9 +442,9 @@
+                     // it still gets marked as present.
+                     Debug.Assert(earlyData is { 
UnmanagedCallersOnlyAttributePresent: true });
+                 }
+-                else if (earlyData is null or { 
UnmanagedCallersOnlyAttributePresent: false })
++                else if (earlyData == null || (earlyData is { 
UnmanagedCallersOnlyAttributePresent: false }))
+                 {
+-                    Debug.Assert(lateData is null or { 
UnmanagedCallersOnlyAttributeData: null });
++                    Debug.Assert(lateData == null || (lateData is { 
UnmanagedCallersOnlyAttributeData: null }));
+                 }
+             }
+ #endif
+@@ -933,7 +933,7 @@
+ 
+             static UnmanagedCallersOnlyAttributeData 
DecodeUnmanagedCallersOnlyAttributeData(SourceMethodSymbolWithAttributes @this, 
CSharpAttributeData attribute, Location location, DiagnosticBag diagnostics)
+             {
+-                Debug.Assert(attribute.AttributeClass is not null);
++                Debug.Assert(attribute.AttributeClass is object);
+                 
ImmutableHashSet<CodeAnalysis.Symbols.INamedTypeSymbolInternal>? 
callingConventionTypes = null;
+                 if (attribute.CommonNamedArguments is { IsDefaultOrEmpty: 
false } namedArgs)
+                 {
+@@ -945,7 +945,7 @@
+                         // member results in an Ambiguous Member error, and 
we never get to this piece of code at all.
+                         // See 
UnmanagedCallersOnly_PropertyAndFieldNamedCallConvs for an example
+                         bool isField = 
attribute.AttributeClass.GetMembers(key).Any(
+-                            static (m, systemType) => m is FieldSymbol { 
Type: ArrayTypeSymbol { ElementType: NamedTypeSymbol elementType } } && 
elementType.Equals(systemType, TypeCompareKind.ConsiderEverything),
++                            (m, systemType) => m is FieldSymbol { Type: 
ArrayTypeSymbol { ElementType: NamedTypeSymbol elementType } } && 
elementType.Equals(systemType, TypeCompareKind.ConsiderEverything),
+                             systemType);
+ 
+                         var namedArgumentDecoded = 
TryDecodeUnmanagedCallersOnlyCallConvsField(key, value, isField, location, 
diagnostics);
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedRecordPrintMembers.cs
        2026-04-10 00:08:17.426300644 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedRecordPrintMembers.cs
      2026-04-10 02:52:52.317491602 +0000
+@@ -170,7 +170,7 @@
+                         _ => throw 
ExceptionUtilities.UnexpectedValue(member.Kind)
+                     };
+ 
+-                    Debug.Assert(value.Type is not null);
++                    Debug.Assert(value.Type is object);
+                     if (value.Type.IsValueType)
+                     {
+                         block.Add(F.ExpressionStatement(
+@@ -222,7 +222,7 @@
+                 if (m.Kind is SymbolKind.Property)
+                 {
+                     var property = (PropertySymbol)m;
+-                    return !property.IsIndexer && !property.IsOverride && 
property.GetMethod is not null;
++                    return !property.IsIndexer && !property.IsOverride && 
property.GetMethod != null;
+                 }
+ 
+                 return false;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- roslyn-3.8-clean/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxNode.cs  
2026-04-10 00:08:17.429360529 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxNode.cs     
   2026-04-10 02:52:52.317599594 +0000
+@@ -114,7 +114,7 @@
+             return tree;
+         }
+ 
+-        public abstract TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> 
visitor);
++        public abstract TResult Accept<TResult>(CSharpSyntaxVisitor<TResult> 
visitor);
+ 
+         public abstract void Accept(CSharpSyntaxVisitor visitor);
+ 
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- roslyn-3.8-clean/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs  
2026-04-10 00:08:17.429360529 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs     
   2026-04-10 02:52:52.317739226 +0000
+@@ -724,7 +724,8 @@
+         {
+             return provider?.IsGenerated(this, cancellationToken) switch
+             {
+-                null or GeneratedKind.Unknown => isGeneratedHeuristic(),
++                null => isGeneratedHeuristic(),
++                GeneratedKind.Unknown => isGeneratedHeuristic(),
+                 GeneratedKind kind => kind != GeneratedKind.NotGenerated
+             };
+ 
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- 
roslyn-3.8-clean/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxVisitor.cs    
   2026-04-10 00:08:17.429360529 +0000
++++ 
roslyn-3.8-patched/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxVisitor.cs  
   2026-04-10 02:52:52.317864370 +0000
+@@ -16,7 +16,7 @@
+     /// </typeparam>
+     public abstract partial class CSharpSyntaxVisitor<TResult>
+     {
+-        public virtual TResult? Visit(SyntaxNode? node)
++        public virtual TResult Visit(SyntaxNode? node)
+         {
+             if (node != null)
+             {
+@@ -27,7 +27,7 @@
+             return default;
+         }
+ 
+-        public virtual TResult? DefaultVisit(SyntaxNode node)
++        public virtual TResult DefaultVisit(SyntaxNode node)
+         {
+             return default;
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/CSharp/P [...]
+--- roslyn-3.8-clean/src/Compilers/CSharp/Portable/Syntax/SyntaxFacts.cs       
2026-04-10 00:08:17.430559025 +0000
++++ roslyn-3.8-patched/src/Compilers/CSharp/Portable/Syntax/SyntaxFacts.cs     
2026-04-10 02:52:52.317942367 +0000
+@@ -554,7 +554,7 @@
+             return node is object &&
+                    node.DescendantNodesAndSelf(child =>
+                    {
+-                       Debug.Assert(ReferenceEquals(node, child) || child is 
not (MemberDeclarationSyntax or TypeDeclarationSyntax));
++                       Debug.Assert(ReferenceEquals(node, child) || !(child 
is MemberDeclarationSyntax || child is TypeDeclarationSyntax));
+                        return !IsNestedFunction(child) && !(node is 
ExpressionSyntax);
+                    }).Any(n => n is YieldStatementSyntax);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/CodeGen/TokenMap.cs   
2026-04-10 00:08:17.562148886 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/CodeGen/TokenMap.cs 
2026-04-10 02:52:52.318057302 +0000
+@@ -24,8 +24,8 @@
+     /// </summary>
+     internal sealed class TokenMap
+     {
+-        private readonly ConcurrentDictionary<IReferenceOrISignature, uint> 
_itemIdentityToToken = new();
+-        private readonly Dictionary<IReferenceOrISignatureEquivalent, uint> 
_itemEquivalentToToken = new();
++        private readonly ConcurrentDictionary<IReferenceOrISignature, uint> 
_itemIdentityToToken = new ConcurrentDictionary<IReferenceOrISignature, uint>();
++        private readonly Dictionary<IReferenceOrISignatureEquivalent, uint> 
_itemEquivalentToToken = new Dictionary<IReferenceOrISignatureEquivalent, 
uint>();
+         private object[] _items = Array.Empty<object>();
+         private int _count = 0;
+ 
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs
       2026-04-10 00:08:17.563679485 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs
     2026-04-10 02:52:52.318150627 +0000
+@@ -392,7 +392,7 @@
+             return false;
+         }
+ 
+-        public static async ValueTask<T?> FirstOrDefaultAsync<T>(this 
ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
++        public static async ValueTask<T> FirstOrDefaultAsync<T>(this 
ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
+         {
+             int n = array.Length;
+             for (int i = 0; i < n; i++)
+@@ -639,16 +639,16 @@
+         // TODO(https://github.com/dotnet/corefx/issues/34126): Remove when 
System.Collections.Immutable
+         // provides a Span API
+         internal static T[] DangerousGetUnderlyingArray<T>(this 
ImmutableArray<T> array)
+-            => Unsafe.As<ImmutableArray<T>, ImmutableArrayProxy<T>>(ref 
array).MutableArray;
++            => System.Linq.Enumerable.ToArray(array);
+ 
+         internal static ReadOnlySpan<T> AsSpan<T>(this ImmutableArray<T> 
array)
+             => array.DangerousGetUnderlyingArray();
+ 
+         internal static ImmutableArray<T> 
DangerousCreateFromUnderlyingArray<T>([MaybeNull] ref T[] array)
+         {
+-            var proxy = new ImmutableArrayProxy<T> { MutableArray = array };
+-            array = null!;
+-            return Unsafe.As<ImmutableArrayProxy<T>, ImmutableArray<T>>(ref 
proxy);
++            var result = ImmutableArray.CreateRange(array);
++            array = null;
++            return result;
+         }
+ 
+         internal static Dictionary<K, ImmutableArray<T>> ToDictionary<K, 
T>(this ImmutableArray<T> items, Func<T, K> keySelector, IEqualityComparer<K>? 
comparer = null)
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/Compilation/Compilation.cs    
2026-04-10 00:08:17.565622216 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/Compilation/Compilation.cs  
2026-04-10 02:52:52.318357565 +0000
+@@ -2828,7 +2828,7 @@
+ 
+             if (moduleBeingBuilt.DebugInformationFormat == 
DebugInformationFormat.Embedded && !RoslynString.IsNullOrEmpty(pePdbFilePath))
+             {
+-                pePdbFilePath = PathUtilities.GetFileName(pePdbFilePath);
++                pePdbFilePath = 
Roslyn.Utilities.PathUtilities.GetFileName(pePdbFilePath);
+             }
+ 
+             EmitStream? emitPeStream = null;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalysisState.cs
   2026-04-10 00:08:17.569325578 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalysisState.cs
 2026-04-10 02:52:52.318629785 +0000
+@@ -232,11 +232,11 @@
+ 
+                     break;
+ 
+-                case CompilationStartedEvent:
++                case CompilationStartedEvent _:
+                     
compilationStartedOrCompletedEventCommon(compilationEvent, add);
+                     break;
+ 
+-                case CompilationCompletedEvent:
++                case CompilationCompletedEvent _:
+                     
compilationStartedOrCompletedEventCommon(compilationEvent, add);
+                     if (!add)
+                     {
+@@ -318,9 +318,9 @@
+         {
+             return compilationEvent switch
+             {
+-                CompilationStartedEvent => 
actionCounts.CompilationActionsCount > 0 || actionCounts.SyntaxTreeActionsCount 
> 0 || actionCounts.AdditionalFileActionsCount > 0,
+-                CompilationCompletedEvent => 
actionCounts.CompilationEndActionsCount > 0,
+-                SymbolDeclaredCompilationEvent => 
actionCounts.SymbolActionsCount > 0 || actionCounts.HasAnyExecutableCodeActions,
++                CompilationStartedEvent _ => 
actionCounts.CompilationActionsCount > 0 || actionCounts.SyntaxTreeActionsCount 
> 0 || actionCounts.AdditionalFileActionsCount > 0,
++                CompilationCompletedEvent _ => 
actionCounts.CompilationEndActionsCount > 0,
++                SymbolDeclaredCompilationEvent _ => 
actionCounts.SymbolActionsCount > 0 || actionCounts.HasAnyExecutableCodeActions,
+                 _ => actionCounts.SemanticModelActionsCount > 0
+             };
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
        2026-04-10 00:08:17.569325578 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
      2026-04-10 02:52:52.318804652 +0000
+@@ -1923,7 +1923,7 @@
+             AnalysisState? analysisState,
+             out AnalyzerStateData? analyzerState)
+         {
+-            Debug.Assert(nonSymbolCompilationEvent is not 
SymbolDeclaredCompilationEvent);
++            Debug.Assert(!(nonSymbolCompilationEvent is 
SymbolDeclaredCompilationEvent));
+             Debug.Assert(analysisScope.Contains(analyzer));
+ 
+             analyzerState = null;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/DiagnosticAnalyzer/AsyncQueue.cs   
   2026-04-10 00:08:17.569325578 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/DiagnosticAnalyzer/AsyncQueue.cs 
   2026-04-10 02:52:52.319002413 +0000
+@@ -308,7 +308,7 @@
+ 
+             var cancelableTaskCompletionSource = new 
CancelableTaskCompletionSource<T>(taskCompletionSource, cancellationToken);
+             cancelableTaskCompletionSource.CancellationTokenRegistration = 
cancellationToken.Register(
+-                static s =>
++                s =>
+                 {
+                     var t = (CancelableTaskCompletionSource<T>)s!;
+                     
t.TaskCompletionSource.TrySetCanceled(t.CancellationToken);
+@@ -318,7 +318,7 @@
+ 
+             
Debug.Assert(taskCompletionSource.Task.CreationOptions.HasFlag(TaskCreationOptions.RunContinuationsAsynchronously));
+             taskCompletionSource.Task.ContinueWith(
+-                static (_, s) =>
++                (_, s) =>
+                 {
+                     var t = (CancelableTaskCompletionSource<T>)s!;
+                     t.CancellationTokenRegistration.Dispose();
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs 
2026-04-10 00:08:17.572862377 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs    
   2026-04-10 02:52:52.319123981 +0000
+@@ -33,9 +33,9 @@
+         internal Cci.IMethodReference DebugEntryPoint;
+ 
+         private readonly ConcurrentDictionary<IMethodSymbolInternal, 
Cci.IMethodBody> _methodBodyMap;
+-        private readonly TokenMap _referencesInILMap = new();
+-        private readonly ItemTokenMap<string> _stringsInILMap = new();
+-        private readonly ItemTokenMap<Cci.DebugSourceDocument> 
_sourceDocumentsInILMap = new();
++        private readonly TokenMap _referencesInILMap = new TokenMap();
++        private readonly ItemTokenMap<string> _stringsInILMap = new 
ItemTokenMap<string>();
++        private readonly ItemTokenMap<Cci.DebugSourceDocument> 
_sourceDocumentsInILMap = new ItemTokenMap<Cci.DebugSourceDocument>();
+ 
+         private ImmutableArray<Cci.AssemblyReferenceAlias> 
_lazyAssemblyReferenceAliases;
+         private ImmutableArray<Cci.ManagedResource> _lazyManagedResources;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/Emit/EditAndContinue/DeltaMetadataWriter.cs
   2026-04-10 00:08:17.573029109 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/Emit/EditAndContinue/DeltaMetadataWriter.cs
 2026-04-10 02:52:52.319290483 +0000
+@@ -633,7 +633,7 @@
+ 
+             if (localVariables.Length > 0)
+             {
+-                var writer = PooledBlobBuilder.GetInstance();
++                var writer = Microsoft.Cci.PooledBlobBuilder.GetInstance();
+                 var encoder = new 
BlobEncoder(writer).LocalVariableSignature(localVariables.Length);
+ 
+                 foreach (ILocalDefinition local in localVariables)
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/EncodedStringText.cs  
2026-04-10 00:08:17.573874584 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/EncodedStringText.cs        
2026-04-10 02:52:52.319442998 +0000
+@@ -33,11 +33,11 @@
+         {
+             try
+             {
+-                if (CodePagesEncodingProvider.Instance != null)
++                if (false)
+                 {
+                     // If we're running on CoreCLR we have to register the 
CodePagesEncodingProvider
+                     // first
+-                    
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
++                    // not available in Mono
+                 }
+ 
+                 // Try to get the default ANSI code page in the operating 
system's
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/FileSystem/PathUtilities.cs   
2026-04-10 00:08:17.574345176 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/FileSystem/PathUtilities.cs 
2026-04-10 02:52:52.319545791 +0000
+@@ -767,7 +767,7 @@
+         internal static class TestAccessor
+         {
+             internal static string? GetDirectoryName(string path, bool 
isUnixLike)
+-                => PathUtilities.GetDirectoryName(path, isUnixLike);
++                => Roslyn.Utilities.PathUtilities.GetDirectoryName(path, 
isUnixLike);
+         }
+     }
+ }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/InternalUtilities/ConsList`1.cs    
   2026-04-10 00:08:17.575615157 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/InternalUtilities/ConsList`1.cs  
   2026-04-10 02:52:52.319660015 +0000
+@@ -19,12 +19,12 @@
+     {
+         public static readonly ConsList<T> Empty = new ConsList<T>();
+ 
+-        private readonly T? _head;
++        private readonly T _head;
+         private readonly ConsList<T>? _tail;
+ 
+         internal struct Enumerator : IEnumerator<T>
+         {
+-            private T? _current;
++            private T _current;
+             private ConsList<T> _tail;
+ 
+             internal Enumerator(ConsList<T> list)
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/InternalUtilities/EnumerableExtensions.cs
     2026-04-10 00:08:17.575615157 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/InternalUtilities/EnumerableExtensions.cs
   2026-04-10 02:52:52.319741468 +0000
+@@ -529,7 +529,7 @@
+         /// Returns the only element of specified sequence if it has exactly 
one, and default(TSource) otherwise.
+         /// Unlike <see 
cref="Enumerable.SingleOrDefault{TSource}(IEnumerable{TSource})"/> doesn't 
throw if there is more than one element in the sequence.
+         /// </summary>
+-        internal static TSource? AsSingleton<TSource>(this 
IEnumerable<TSource>? source)
++        internal static TSource AsSingleton<TSource>(this 
IEnumerable<TSource>? source)
+         {
+             if (source == null)
+             {
+@@ -620,7 +620,7 @@
+             return true;
+         }
+ 
+-        public static T? AggregateOrDefault<T>(this IEnumerable<T> source, 
Func<T, T, T> func)
++        public static T AggregateOrDefault<T>(this IEnumerable<T> source, 
Func<T, T, T> func)
+         {
+             using (var e = source.GetEnumerator())
+             {
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/InternalUtilities/OneOrMany.cs     
   2026-04-10 00:08:17.575615157 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/InternalUtilities/OneOrMany.cs   
   2026-04-10 02:52:52.319839101 +0000
+@@ -19,7 +19,7 @@
+     internal struct OneOrMany<T>
+         where T : notnull
+     {
+-        private readonly T? _one;
++        private readonly T _one;
+         private readonly ImmutableArray<T> _many;
+ 
+         public OneOrMany(T one)
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/InternalUtilities/ReflectionUtilities.cs
      2026-04-10 00:08:17.575615157 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/InternalUtilities/ReflectionUtilities.cs
    2026-04-10 02:52:52.319919030 +0000
+@@ -117,7 +117,7 @@
+             return (T)methodInfo.CreateDelegate(typeof(T));
+         }
+ 
+-        public static T? InvokeConstructor<T>(this ConstructorInfo? 
constructorInfo, params object?[] args)
++        public static T InvokeConstructor<T>(this ConstructorInfo? 
constructorInfo, params object?[] args)
+         {
+             if (constructorInfo == null)
+             {
+@@ -126,7 +126,7 @@
+ 
+             try
+             {
+-                return (T?)constructorInfo.Invoke(args);
++                return (T)constructorInfo.Invoke(args);
+             }
+             catch (TargetInvocationException e)
+             {
+@@ -142,9 +142,9 @@
+             return constructorInfo.InvokeConstructor<object?>(args);
+         }
+ 
+-        public static T? Invoke<T>(this MethodInfo methodInfo, object obj, 
params object?[] args)
++        public static T Invoke<T>(this MethodInfo methodInfo, object obj, 
params object?[] args)
+         {
+-            return (T?)methodInfo.Invoke(obj, args);
++            return (T)methodInfo.Invoke(obj, args);
+         }
+     }
+ }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/InternalUtilities/RoslynLazyInitializer.cs
    2026-04-10 00:08:17.575615157 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/InternalUtilities/RoslynLazyInitializer.cs
  2026-04-10 02:52:52.319995063 +0000
+@@ -21,11 +21,11 @@
+             => LazyInitializer.EnsureInitialized<T>(ref target!, 
valueFactory);
+ 
+         /// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, ref 
bool, ref object)"/>
+-        public static T EnsureInitialized<T>([NotNull] ref T? target, ref 
bool initialized, [NotNull] ref object? syncLock)
+-            => LazyInitializer.EnsureInitialized<T>(ref target!, ref 
initialized, ref syncLock);
++        public static T EnsureInitialized<T>([NotNull] ref T target, ref bool 
initialized, [NotNull] ref object? syncLock)
++            => LazyInitializer.EnsureInitialized<T>(ref target, ref 
initialized, ref syncLock);
+ 
+         /// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, ref 
bool, ref object, Func{T})"/>
+-        public static T EnsureInitialized<T>([NotNull] ref T? target, ref 
bool initialized, [NotNull] ref object? syncLock, Func<T> valueFactory)
+-            => LazyInitializer.EnsureInitialized<T>(ref target!, ref 
initialized, ref syncLock, valueFactory);
++        public static T EnsureInitialized<T>([NotNull] ref T target, ref bool 
initialized, [NotNull] ref object? syncLock, Func<T> valueFactory)
++            => LazyInitializer.EnsureInitialized<T>(ref target, ref 
initialized, ref syncLock, valueFactory);
+     }
+ }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/InternalUtilities/WeakReferenceExtensions.cs
  2026-04-10 00:08:17.575687950 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/InternalUtilities/WeakReferenceExtensions.cs
        2026-04-10 02:52:52.320058532 +0000
+@@ -11,7 +11,7 @@
+     // Helpers that are missing from Dev11 implementation:
+     internal static class WeakReferenceExtensions
+     {
+-        public static T? GetTarget<T>(this WeakReference<T> reference) where 
T : class?
++        public static T GetTarget<T>(this WeakReference<T> reference) where T 
: class?
+         {
+             reference.TryGetTarget(out var target);
+             return target;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/MetadataReader/PEModule.cs    
2026-04-10 00:08:17.578106367 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/MetadataReader/PEModule.cs  
2026-04-10 02:52:52.320221617 +0000
+@@ -1172,7 +1172,7 @@
+                         }
+                     }
+                 }
+-                catch (Exception ex) when (ex is BadImageFormatException or 
UnsupportedSignatureContent)
++                catch (Exception ex) when (ex is BadImageFormatException || 
ex is UnsupportedSignatureContent)
+                 {
+                 }
+             }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/PEWriter/Members.cs   
2026-04-10 00:08:17.582009142 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/PEWriter/Members.cs 
2026-04-10 02:52:52.320494539 +0000
+@@ -60,7 +60,7 @@
+         /// Extensible calling convention protocol. This represents either 
the union of calling convention modopts after the paramcount specifier
+         /// in IL, or platform default if none are present
+         /// </summary>
+-        Unmanaged = SignatureCallingConvention.Unmanaged,
++        Unmanaged = 9,
+ 
+         /// <summary>
+         /// The convention for calling a generic method.
+@@ -87,7 +87,7 @@
+             | SignatureCallingConvention.ThisCall
+             | SignatureCallingConvention.FastCall
+             | SignatureCallingConvention.VarArgs
+-            | SignatureCallingConvention.Unmanaged;
++            | (SignatureCallingConvention)9;
+ 
+         private const SignatureAttributes SignatureAttributesMask =
+             SignatureAttributes.Generic
+@@ -105,7 +105,7 @@
+         }
+ 
+         internal static bool IsValid(this SignatureCallingConvention 
convention)
+-            => convention <= SignatureCallingConvention.VarArgs || convention 
== SignatureCallingConvention.Unmanaged;
++            => convention <= SignatureCallingConvention.VarArgs || convention 
== (SignatureCallingConvention)9;
+ 
+         internal static SignatureCallingConvention ToSignatureConvention(this 
CallingConvention convention)
+             => (SignatureCallingConvention)convention & 
SignatureCallingConventionMask;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/PEWriter/MetadataWriter.PortablePdb.cs
        2026-04-10 00:08:17.582009142 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/PEWriter/MetadataWriter.PortablePdb.cs
      2026-04-10 02:52:52.320633790 +0000
+@@ -914,7 +914,7 @@
+             {
+                 if (metadataReference is PortableExecutableReference 
portableReference && portableReference.FilePath is object)
+                 {
+-                    var fileName = 
PathUtilities.GetFileName(portableReference.FilePath);
++                    var fileName = 
Roslyn.Utilities.PathUtilities.GetFileName(portableReference.FilePath);
+                     var reference = 
module.CommonCompilation.GetAssemblyOrModuleSymbol(portableReference);
+                     var peReader = GetReader(reference);
+ 
+@@ -939,12 +939,12 @@
+                         ? 0b10
+                         : 0b0);
+ 
+-                    kindAndEmbedInteropTypes |= 
portableReference.Properties.Kind switch
++                    kindAndEmbedInteropTypes |= 
(byte)(portableReference.Properties.Kind switch
+                     {
+                         MetadataImageKind.Assembly => 1,
+                         MetadataImageKind.Module => 0,
+                         _ => throw 
ExceptionUtilities.UnexpectedValue(portableReference.Properties.Kind)
+-                    };
++                    });
+ 
+                     builder.WriteByte(kindAndEmbedInteropTypes);
+                     
builder.WriteInt32(peReader.PEHeaders.CoffHeader.TimeDateStamp);
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/PEWriter/PeWriter.cs  
2026-04-10 00:08:17.582009142 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/PEWriter/PeWriter.cs        
2026-04-10 02:52:52.320763934 +0000
+@@ -348,7 +348,7 @@
+                 _resourceSection = resourceSection;
+             }
+ 
+-            protected override void Serialize(BlobBuilder builder, 
SectionLocation location)
++            protected internal override void Serialize(BlobBuilder builder, 
SectionLocation location)
+             {
+                 NativeResourceWriter.SerializeWin32Resources(builder, 
_resourceSection, location.RelativeVirtualAddress);
+             }
+@@ -364,7 +364,7 @@
+                 _resources = resources;
+             }
+ 
+-            protected override void Serialize(BlobBuilder builder, 
SectionLocation location)
++            protected internal override void Serialize(BlobBuilder builder, 
SectionLocation location)
+             {
+                 NativeResourceWriter.SerializeWin32Resources(builder, 
_resources, location.RelativeVirtualAddress);
+             }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/PEWriter/ReferenceIndexerBase.cs   
   2026-04-10 00:08:17.582009142 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/PEWriter/ReferenceIndexerBase.cs 
   2026-04-10 02:52:52.320863791 +0000
+@@ -13,8 +13,8 @@
+ {
+     internal abstract class ReferenceIndexerBase : MetadataVisitor
+     {
+-        private readonly HashSet<IReferenceOrISignatureEquivalent> 
_alreadySeen = new();
+-        private readonly HashSet<IReferenceOrISignatureEquivalent> 
_alreadyHasToken = new();
++        private readonly HashSet<IReferenceOrISignatureEquivalent> 
_alreadySeen = new HashSet<IReferenceOrISignatureEquivalent>();
++        private readonly HashSet<IReferenceOrISignatureEquivalent> 
_alreadyHasToken = new HashSet<IReferenceOrISignatureEquivalent>();
+         protected bool typeReferenceNeedsToken;
+ 
+         internal ReferenceIndexerBase(EmitContext context)
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/StrongName/DesktopStrongNameProvider.cs
       2026-04-10 00:08:17.588983134 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/StrongName/DesktopStrongNameProvider.cs
     2026-04-10 02:52:52.320972274 +0000
+@@ -55,7 +55,7 @@
+ 
+         internal DesktopStrongNameProvider(ImmutableArray<string> 
keyFileSearchPaths, StrongNameFileSystem strongNameFileSystem)
+         {
+-            if (!keyFileSearchPaths.IsDefault && keyFileSearchPaths.Any(path 
=> !PathUtilities.IsAbsolute(path)))
++            if (!keyFileSearchPaths.IsDefault && keyFileSearchPaths.Any(path 
=> !Roslyn.Utilities.PathUtilities.IsAbsolute(path)))
+             {
+                 throw new 
ArgumentException(CodeAnalysisResources.AbsolutePathExpected, 
nameof(keyFileSearchPaths));
+             }
+@@ -80,7 +80,7 @@
+                         return new 
StrongNameKeys(StrongNameKeys.GetKeyFileError(messageProvider, keyFilePath, 
CodeAnalysisResources.FileNotFound));
+                     }
+ 
+-                    Debug.Assert(PathUtilities.IsAbsolute(resolvedKeyFile));
++                    
Debug.Assert(Roslyn.Utilities.PathUtilities.IsAbsolute(resolvedKeyFile));
+                     var fileContent = 
ImmutableArray.Create(FileSystem.ReadAllBytes(resolvedKeyFile));
+                     return StrongNameKeys.CreateHelper(fileContent, 
keyFilePath, hasCounterSignature);
+                 }
+@@ -117,9 +117,9 @@
+         internal static string? ResolveStrongNameKeyFile(string path, 
StrongNameFileSystem fileSystem, ImmutableArray<string> keyFileSearchPaths)
+         {
+             // Dev11: key path is simply appended to the search paths, even 
if it starts with the current (parent) directory ("." or "..").
+-            // This is different from PathUtilities.ResolveRelativePath.
++            // This is different from 
Roslyn.Utilities.PathUtilities.ResolveRelativePath.
+ 
+-            if (PathUtilities.IsAbsolute(path))
++            if (Roslyn.Utilities.PathUtilities.IsAbsolute(path))
+             {
+                 if (fileSystem.FileExists(path))
+                 {
+@@ -131,9 +131,9 @@
+ 
+             foreach (var searchPath in keyFileSearchPaths)
+             {
+-                string? combinedPath = 
PathUtilities.CombineAbsoluteAndRelativePaths(searchPath, path);
++                string? combinedPath = 
Roslyn.Utilities.PathUtilities.CombineAbsoluteAndRelativePaths(searchPath, 
path);
+ 
+-                Debug.Assert(combinedPath == null || 
PathUtilities.IsAbsolute(combinedPath));
++                Debug.Assert(combinedPath == null || 
Roslyn.Utilities.PathUtilities.IsAbsolute(combinedPath));
+ 
+                 if (fileSystem.FileExists(combinedPath))
+                 {
+@@ -192,7 +192,7 @@
+             {
+                 return ClrStrongName.GetInstance();
+             }
+-            catch (MarshalDirectiveException) when 
(PathUtilities.IsUnixLikePlatform)
++            catch (MarshalDirectiveException) when 
(Roslyn.Utilities.PathUtilities.IsUnixLikePlatform)
+             {
+                 // CoreCLR, when not on Windows, doesn't support 
IClrStrongName (or COM in general).
+                 // This is really hard to detect/predict without false 
positives/negatives.
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/Symbols/Attributes/CommonAttributeData.cs
     2026-04-10 00:08:17.589891927 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/Symbols/Attributes/CommonAttributeData.cs
   2026-04-10 02:52:52.321082941 +0000
+@@ -140,7 +140,7 @@
+         /// Returns the value of a constructor argument as type <typeparamref 
name="T"/>.
+         /// Throws if no constructor argument exists or the argument cannot 
be converted to the type.
+         /// </summary>
+-        internal T? GetConstructorArgument<T>(int i, SpecialType specialType)
++        internal T GetConstructorArgument<T>(int i, SpecialType specialType)
+         {
+             var constructorArgs = this.CommonConstructorArguments;
+             return constructorArgs[i].DecodeValue<T>(specialType);
+@@ -158,12 +158,12 @@
+         /// For user defined attributes VB allows duplicate named arguments 
and uses the last value.
+         /// Dev11 reports an error for pseudo-custom attributes when emitting 
metadata. We don't.
+         /// </remarks>
+-        internal T? DecodeNamedArgument<T>(string name, SpecialType 
specialType, T? defaultValue = default)
++        internal T DecodeNamedArgument<T>(string name, SpecialType 
specialType, T defaultValue = default)
+         {
+             return DecodeNamedArgument<T>(CommonNamedArguments, name, 
specialType, defaultValue);
+         }
+ 
+-        private static T? 
DecodeNamedArgument<T>(ImmutableArray<KeyValuePair<string, TypedConstant>> 
namedArguments, string name, SpecialType specialType, T? defaultValue = default)
++        private static T 
DecodeNamedArgument<T>(ImmutableArray<KeyValuePair<string, TypedConstant>> 
namedArguments, string name, SpecialType specialType, T defaultValue = default)
+         {
+             int index = IndexOfNamedArgument(namedArguments, name);
+             return index >= 0 ? 
namedArguments[index].Value.DecodeValue<T>(specialType) : defaultValue;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- 
roslyn-3.8-clean/src/Compilers/Core/Portable/Symbols/Attributes/UnmanagedCallersOnlyAttributeData.cs
       2026-04-10 00:08:17.589891927 +0000
++++ 
roslyn-3.8-patched/src/Compilers/Core/Portable/Symbols/Attributes/UnmanagedCallersOnlyAttributeData.cs
     2026-04-10 02:52:52.321191705 +0000
+@@ -22,7 +22,8 @@
+         internal static UnmanagedCallersOnlyAttributeData 
Create(ImmutableHashSet<INamedTypeSymbolInternal>? callingConventionTypes)
+             => callingConventionTypes switch
+             {
+-                null or { IsEmpty: true } => PlatformDefault,
++                null => PlatformDefault,
++                { IsEmpty: true } => PlatformDefault,
+                 _ => new 
UnmanagedCallersOnlyAttributeData(callingConventionTypes)
+             };
+ 
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/Symbols/SymbolVisitor`1.cs    
2026-04-10 00:08:17.589891927 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/Symbols/SymbolVisitor`1.cs  
2026-04-10 02:52:52.321287665 +0000
+@@ -8,109 +8,109 @@
+ {
+     public abstract class SymbolVisitor<TResult>
+     {
+-        public virtual TResult? Visit(ISymbol? symbol)
++        public virtual TResult Visit(ISymbol? symbol)
+         {
+             return symbol == null
+-                ? default(TResult?)
++                ? default(TResult)
+                 : symbol.Accept(this);
+         }
+ 
+-        public virtual TResult? DefaultVisit(ISymbol symbol)
++        public virtual TResult DefaultVisit(ISymbol symbol)
+         {
+-            return default(TResult?);
++            return default(TResult);
+         }
+ 
+-        public virtual TResult? VisitAlias(IAliasSymbol symbol)
++        public virtual TResult VisitAlias(IAliasSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitArrayType(IArrayTypeSymbol symbol)
++        public virtual TResult VisitArrayType(IArrayTypeSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitAssembly(IAssemblySymbol symbol)
++        public virtual TResult VisitAssembly(IAssemblySymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitDiscard(IDiscardSymbol symbol)
++        public virtual TResult VisitDiscard(IDiscardSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitDynamicType(IDynamicTypeSymbol symbol)
++        public virtual TResult VisitDynamicType(IDynamicTypeSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitEvent(IEventSymbol symbol)
++        public virtual TResult VisitEvent(IEventSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitField(IFieldSymbol symbol)
++        public virtual TResult VisitField(IFieldSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitLabel(ILabelSymbol symbol)
++        public virtual TResult VisitLabel(ILabelSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitLocal(ILocalSymbol symbol)
++        public virtual TResult VisitLocal(ILocalSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitMethod(IMethodSymbol symbol)
++        public virtual TResult VisitMethod(IMethodSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitModule(IModuleSymbol symbol)
++        public virtual TResult VisitModule(IModuleSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitNamedType(INamedTypeSymbol symbol)
++        public virtual TResult VisitNamedType(INamedTypeSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitNamespace(INamespaceSymbol symbol)
++        public virtual TResult VisitNamespace(INamespaceSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitParameter(IParameterSymbol symbol)
++        public virtual TResult VisitParameter(IParameterSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitPointerType(IPointerTypeSymbol symbol)
++        public virtual TResult VisitPointerType(IPointerTypeSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? 
VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol)
++        public virtual TResult 
VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitProperty(IPropertySymbol symbol)
++        public virtual TResult VisitProperty(IPropertySymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitRangeVariable(IRangeVariableSymbol 
symbol)
++        public virtual TResult VisitRangeVariable(IRangeVariableSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+ 
+-        public virtual TResult? VisitTypeParameter(ITypeParameterSymbol 
symbol)
++        public virtual TResult VisitTypeParameter(ITypeParameterSymbol symbol)
+         {
+             return DefaultVisit(symbol);
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/Symbols/TypedConstant.cs      
2026-04-10 00:08:17.589891927 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/Symbols/TypedConstant.cs    
2026-04-10 02:52:52.321373636 +0000
+@@ -126,7 +126,7 @@
+             }
+         }
+ 
+-        internal T? DecodeValue<T>(SpecialType specialType)
++        internal T DecodeValue<T>(SpecialType specialType)
+         {
+             TryDecodeValue(specialType, out T value);
+             return value;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Core/Por [...]
+--- roslyn-3.8-clean/src/Compilers/Core/Portable/Text/TextChange.cs    
2026-04-10 00:08:17.595607440 +0000
++++ roslyn-3.8-patched/src/Compilers/Core/Portable/Text/TextChange.cs  
2026-04-10 02:52:52.321592145 +0000
+@@ -99,8 +99,8 @@
+             var newTextDisplay = NewText switch
+             {
+                 null => "null",
+-                { Length: < 10 } => $"\"{NewText}\"",
+-                { Length: var length } => $"(NewLength = {length})"
++                _ when NewText.Length < 10 => $"\"{NewText}\"",
++                _ when NewText != null => $"(NewLength = {NewText.Length})"
+             };
+             return $"new TextChange(new TextSpan({Span.Start}, 
{Span.Length}), {newTextDisplay})";
+         }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Compilers/Shared/B [...]
+--- roslyn-3.8-clean/src/Compilers/Shared/BuildClient.cs       2026-04-10 
00:08:17.604992792 +0000
++++ roslyn-3.8-patched/src/Compilers/Shared/BuildClient.cs     2026-04-10 
02:52:52.321712912 +0000
+@@ -76,12 +76,11 @@
+         internal static int Run(IEnumerable<string> arguments, 
RequestLanguage language, CompileFunc compileFunc)
+         {
+             var sdkDir = GetSystemSdkDirectory();
+-            if (RuntimeHostInfo.IsCoreClrRuntime)
+-            {
+-                // Register encodings for console
+-                // https://github.com/dotnet/roslyn/issues/10785
+-                
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
+-            }
++            // CodePagesEncodingProvider not available on Mono; only needed 
on .NET Core
++            // if (RuntimeHostInfo.IsCoreClrRuntime)
++            // {
++            //     
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
++            // }
+ 
+             var client = new BuildClient(language, compileFunc);
+             var clientDir = AppContext.BaseDirectory;
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Scripting/Core/Hos [...]
+--- 
roslyn-3.8-clean/src/Scripting/Core/Hosting/AssemblyLoader/InteractiveAssemblyLoader.cs
    2026-04-10 00:08:18.018665626 +0000
++++ 
roslyn-3.8-patched/src/Scripting/Core/Hosting/AssemblyLoader/InteractiveAssemblyLoader.cs
  2026-04-10 02:52:52.321822307 +0000
+@@ -170,7 +170,7 @@
+                 throw new ArgumentNullException(nameof(dependency));
+             }
+ 
+-            if (!PathUtilities.IsAbsolute(path))
++            if (!Roslyn.Utilities.PathUtilities.IsAbsolute(path))
+             {
+                 throw new 
ArgumentException(ScriptingResources.AbsolutePathExpected, nameof(path));
+             }
+diff -ruN '--exclude=*.dll' '--exclude=*.exe' '--exclude=*.resources' 
'--exclude=*.Designer.cs' '--exclude=bootstrap-*' '--exclude=*.resx' 
'--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=generated' 
'--exclude=*.orig' '--exclude=*.rej' '--exclude=CSharpSyntaxGenerator.exe' 
'--exclude=Test' '--exclude=*.g4' '--exclude=Syntax.xml.Internal.Generated.cs' 
'--exclude=Syntax.xml.Main.Generated.cs' 
'--exclude=Syntax.xml.Syntax.Generated.cs' 
roslyn-3.8-clean/src/Tools/Source/Compi [...]
+--- 
roslyn-3.8-clean/src/Tools/Source/CompilerGeneratorTools/Source/CSharpSyntaxGenerator/SourceWriter.cs
      2026-04-10 00:08:18.037151666 +0000
++++ 
roslyn-3.8-patched/src/Tools/Source/CompilerGeneratorTools/Source/CSharpSyntaxGenerator/SourceWriter.cs
    2026-04-10 02:52:52.321989079 +0000
+@@ -269,7 +269,7 @@
+                     for (int i = 0, n = nodeFields.Count; i < n; i++)
+                     {
+                         var field = nodeFields[i];
+-                        WriteLine($"{i} => this.{CamelCase(field.Name)},");
++                        WriteLine($"{i} => 
(GreenNode)this.{CamelCase(field.Name)},");
+                     }
+                     WriteLine("_ => null,");
+                     CloseBlock(";");
+@@ -1076,7 +1076,7 @@
+                                 WriteLine($"{index} => GetRed(ref 
this.{CamelCase(field.Name)}, {index}){suffix},");
+                             }
+                         }
+-                        WriteLine("_ => null,");
++                        WriteLine("_ => (SyntaxNode)null,");
+                         CloseBlock(";");
+                         Unindent();
+                     }
+@@ -1109,7 +1109,7 @@
+                         {
+                             WriteLine($"{index} => 
this.{CamelCase(field.Name)},");
+                         }
+-                        WriteLine("_ => null,");
++                        WriteLine("_ => (SyntaxNode)null,");
+                         CloseBlock(";");
+                         Unindent();
+                     }
+@@ -1151,7 +1151,7 @@
+         private void WriteRedAcceptMethod(Node node, bool genericResult)
+         {
+             string genericArgs = genericResult ? "<TResult>" : "";
+-            WriteLine($"public override {(genericResult ? "TResult?" : 
"void")} Accept{genericArgs}(CSharpSyntaxVisitor{genericArgs} 
visitor){(genericResult ? " where TResult : default" : "")} => 
visitor.Visit{StripPost(node.Name, "Syntax")}(this);");
++            WriteLine($"public override {(genericResult ? "TResult" : 
"void")} Accept{genericArgs}(CSharpSyntaxVisitor{genericArgs} visitor) => 
visitor.Visit{StripPost(node.Name, "Syntax")}(this);");
+         }
+ 
+         private void WriteRedVisitors()
+@@ -1175,7 +1175,7 @@
+                     WriteLine();
+                 nWritten++;
+                 WriteComment($"<summary>Called when the visitor visits a 
{node.Name} node.</summary>");
+-                WriteLine($"public virtual {(genericResult ? "TResult?" : 
"void")} Visit{StripPost(node.Name, "Syntax")}({node.Name} node) => 
this.DefaultVisit(node);");
++                WriteLine($"public virtual {(genericResult ? "TResult" : 
"void")} Visit{StripPost(node.Name, "Syntax")}({node.Name} node) => 
this.DefaultVisit(node);");
+             }
+             CloseBlock();
+         }

Reply via email to