A minimalistic library which will prevent code from compiling if var
is used as a type identifier instead of the type name.
To use this library in your project, use one of the following methods:
-
Package Manager:
PM> Install-Package Unknown6656.DontUseVar
-
.NET CLI:
> dotnet add package Unknown6656.DontUseVar
-
Package reference (e.g. in a
.csproj
/.vbproj
/.fsproj
project file):<PackageReference Include="Unknown6656.DontUseVar" Version="*" />
-
Paket CLI:
> paket add Unknown6656.DontUseVar
-
F# Interactive:
#r "nuget: Unknown6656.DontUseVar, *"
Caution
As NuGet dependencies are cascading transitively, it might be wise to reference Unknown6656.DontUseVar
only during Debug mode:
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<PackageReference Include="Unknown6656.DontUseVar" Version="*" />
</ItemGroup>
Otherwise, other code bases using your library will also be forced to not use var, which might lead to breaking changes (especially when anonymous classes are involved).