diff options
author | Stephen Toub <stoub@microsoft.com> | 2022-11-11 22:46:11 +0300 |
---|---|---|
committer | github-actions <github-actions@github.com> | 2022-11-12 02:02:25 +0300 |
commit | 5fede793b77bd9add338c9dd6ded4e72a9d956cf (patch) | |
tree | 73eeff20226213d33ee491370e258be36bf6cbec | |
parent | 985a5adf4d3c7a29bf5d40d501c72641f91a9b0c (diff) |
Address PR feedbackbackport/pr-78228-to-release/7.0
-rw-r--r-- | src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.cs b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.cs index 24943ca441f..da7d936bed5 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.cs +++ b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.cs @@ -36,7 +36,7 @@ namespace System.Text.RegularExpressions.Generator "#pragma warning disable CS0219 // Variable assigned but never used", }; - private sealed record CompilationData(bool AllowUnsafe = false, bool CheckOverflow = false); + private record struct CompilationData(bool AllowUnsafe, bool CheckOverflow); public void Initialize(IncrementalGeneratorInitializationContext context) { @@ -47,7 +47,7 @@ namespace System.Text.RegularExpressions.Generator .Select((x, _) => x.Options is CSharpCompilationOptions options ? new CompilationData(options.AllowUnsafe, options.CheckOverflow) : - new CompilationData()); + default); // Produces one entry per generated regex. This may be: // - Diagnostic in the case of a failure that should end the compilation |