set langversion to latest, and enable nullable types in all projects

This commit is contained in:
13xforever
2025-03-05 12:48:06 +05:00
parent 207f7dc57a
commit 43c7251a57
11 changed files with 20 additions and 12 deletions

View File

@@ -65,13 +65,13 @@ public class AttributeUsageAnalyzer : DiagnosticAnalyzer
private static bool IsDescendantOfAttribute(AttributeData attributeData, string baseAttributeClassNameWithNamespace)
{
var attrClass = attributeData.AttributeClass;
do
while (attrClass is not null)
{
if (attrClass.ToDisplayString() == baseAttributeClassNameWithNamespace)
return true;
attrClass = attrClass.BaseType;
} while (attrClass != null);
}
return false;
}
}

View File

@@ -4,6 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<NoWarn>1701;1702;RS2008;RS1036</NoWarn>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

View File

@@ -95,7 +95,7 @@ public class Win32ErrorsSourceGenerator : ISourceGenerator
previousPos = (int)stream.Position;
var name = nameDescParts[0];
var desc = nameDescParts[1].Replace("\\", "\\\\").Replace("\"", "\\\"");
var desc = nameDescParts[1].Replace(@"\", @"\\").Replace("\"", "\\\"");
result.AppendLine($"{Indent}{Indent}{Indent}[{errorCodeLine.Trim()}] = (\"{name.Trim()}\", \"{desc.Trim()}\"),");
}