Browse Source

Use ReferenceAssemblyAnnotator in ICSharpCode.Decompiler.csproj

pull/2639/head
Siegfried Pammer 3 years ago
parent
commit
6a6e82c372
  1. 8
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
  2. 37
      ICSharpCode.Decompiler/Util/NullAttributes.cs

8
ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

@ -72,6 +72,13 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" />
<!-- Specifies the version of Microsoft.NETCore.App.Ref to obtain nullability information from. -->
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[6.0.0]" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CSharp\Annotations.cs" /> <Compile Include="CSharp\Annotations.cs" />
@ -446,7 +453,6 @@
<Compile Include="Util\GraphVizGraph.cs" /> <Compile Include="Util\GraphVizGraph.cs" />
<Compile Include="Util\KeyComparer.cs" /> <Compile Include="Util\KeyComparer.cs" />
<Compile Include="Util\LongDict.cs" /> <Compile Include="Util\LongDict.cs" />
<Compile Include="Util\NullAttributes.cs" />
<Compile Include="Util\ResourcesFile.cs" /> <Compile Include="Util\ResourcesFile.cs" />
<Compile Include="Util\ResXResourceWriter.cs" /> <Compile Include="Util\ResXResourceWriter.cs" />
<Compile Include="Util\UnicodeNewline.cs" /> <Compile Include="Util\UnicodeNewline.cs" />

37
ICSharpCode.Decompiler/Util/NullAttributes.cs

@ -1,37 +0,0 @@
#if !NETCORE
#nullable enable
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true)]
internal sealed class NotNullIfNotNullAttribute : Attribute
{
public string ParameterName { get; }
public NotNullIfNotNullAttribute(string parameterName)
{
ParameterName = parameterName;
}
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
internal sealed class NotNullWhenAttribute : Attribute
{
public NotNullWhenAttribute(bool returnValue)
{
ReturnValue = returnValue;
}
public bool ReturnValue { get; }
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
internal sealed class DoesNotReturnIfAttribute : Attribute
{
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
public bool ParameterValue { get; }
}
}
#endif
Loading…
Cancel
Save