From 65300cd19e498c2d525be2bc406b3792350bb670 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Fri, 24 Jan 2025 13:14:11 +0100 Subject: [PATCH] React to compiler analyzer warning/error src\System.Private.Windows.Core\src\System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs(352,74): error IDE0082: 'typeof' can be converted to 'nameof' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0082) [D:\a\_work\1\vmr\src\winforms\src\System.Private.Windows.Core\src\System.Private.Windows.Core.csproj::TargetFramework=net10.0] --- .../Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs index 7f9ba95a70b..6537c9da088 100644 --- a/src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs +++ b/src/System.Private.Windows.Core/src/System/Private/Windows/Core/Nrbf/SerializationRecordExtensions.cs @@ -349,7 +349,7 @@ static bool Get(SerializationRecord record, [NotNullWhen(true)] out object? list || !classInfo.HasMember("_size") || classInfo.GetRawValue("_size") is not int size || !classInfo.TypeName.IsConstructedGenericType - || classInfo.TypeName.GetGenericTypeDefinition().Name != typeof(List<>).Name + || classInfo.TypeName.GetGenericTypeDefinition().Name != nameof(List<>) || classInfo.TypeName.GetGenericArguments().Length != 1 || classInfo.GetRawValue("_items") is not ArrayRecord arrayRecord || !IsPrimitiveArrayRecord(arrayRecord))