2 writes to AllowUnsafe
Microsoft.CodeAnalysis.CSharp (2)
CSharpCompilationOptions.cs (2)
226this.AllowUnsafe = allowUnsafe; 420return new CSharpCompilationOptions(this) { AllowUnsafe = enabled };
35 references to AllowUnsafe
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CSharpCompilerTest.cs (1)
95Assert.False(compilationOptions.AllowUnsafe);
Microsoft.CodeAnalysis.CSharp (15)
Binder\Binder_Statements.cs (1)
174if (!this.Compilation.Options.AllowUnsafe)
Binder\ExecutableCodeBinder.cs (1)
130&& compilation.Options.AllowUnsafe) // Don't cascade
Compilation\CSharpCompilation.cs (2)
4756if (Options.AllowUnsafe) 4758writeValue(CompilationOptionNames.Unsafe, Options.AllowUnsafe.ToString());
Compilation\CSharpDeterministicKeyBuilder.cs (1)
29writer.Write("unsafe", csharpOptions.AllowUnsafe);
CSharpCompilationOptions.cs (5)
239allowUnsafe: other.AllowUnsafe, 415if (enabled == this.AllowUnsafe) 742return this.AllowUnsafe == other.AllowUnsafe && 756Hash.Combine(this.AllowUnsafe,
Symbols\Attributes\AttributeData.cs (1)
245if (!compilation.Options.AllowUnsafe)
Symbols\Source\SourceAssemblySymbol.cs (2)
687if (!compilationOptions.AllowUnsafe) 1815if (_compilation.Options.AllowUnsafe)
Symbols\Source\SourceModuleSymbol.cs (1)
629if (compilation.Options.AllowUnsafe)
Symbols\SymbolExtensions.cs (1)
288return symbol.DeclaringCompilation.Options.AllowUnsafe;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
39Assert.True(((CSharpCompilationOptions)newSolution.Projects.Single().CompilationOptions!).AllowUnsafe);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
44pdbOptions.VerifyPdbOption("unsafe", originalOptions.AllowUnsafe);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
39Assert.True(((CSharpCompilationOptions)newSolution.Projects.Single().CompilationOptions!).AllowUnsafe);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\CSharpCompilationOptionsTests.cs (1)
116TestProperty((old, value) => old.WithAllowUnsafe(value), opt => opt.AllowUnsafe, true);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Serialization\CSharpOptionsSerializationService.cs (1)
32writer.WriteBoolean(csharpOptions.AllowUnsafe);
Microsoft.CodeAnalysis.Scripting.UnitTests (1)
ScriptOptionsTests.cs (1)
220Assert.Equal(scriptOptions.AllowUnsafe, compilation.Options.AllowUnsafe);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlCreation.cs (1)
151element.SetAttributeValue(AllowUnsafeAttributeName, csOptions.AllowUnsafe);
Microsoft.Interop.ComInterfaceGenerator (3)
ComClassGenerator.cs (1)
21var unsafeCodeIsEnabled = context.CompilationProvider.Select((comp, ct) => comp.Options is CSharpCompilationOptions { AllowUnsafe: true }); // Unsafe code enabled
ComInterfaceInfo.cs (1)
57if (env.Compilation.Options is not CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
127bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false };
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportGenerator.cs (1)
67|| data.Left.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
JSImportGenerator.cs (1)
65|| data.Left.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
Microsoft.Interop.LibraryImportGenerator (2)
LibraryImportGenerator.cs (1)
73.Select((comp, ct) => comp.Options is CSharpCompilationOptions { AllowUnsafe: true })
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
127bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false };
Microsoft.VisualStudio.LanguageServices.CSharp (4)
Utilities\CSharpCompilationOptionsChangingService.cs (4)
30return oldCSharpOptions.WithAllowUnsafe(newCSharpOptions.AllowUnsafe).WithNullableContextOptions(newCSharpOptions.NullableContextOptions) == newOptions; 38if (newCSharpOptions.AllowUnsafe != oldCSharpOptions.AllowUnsafe) 41newCSharpOptions.AllowUnsafe);
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
211? new CompilationData(compilationOptions.AllowUnsafe, compilationOptions.CheckOverflow, langVersion)