From 439ceef2a226d6dd01e83ca73dd411113c233015 Mon Sep 17 00:00:00 2001 From: sonyps5201314 Date: Thu, 30 Oct 2025 03:45:13 +0800 Subject: [PATCH] Fixed an issue where the copy constructor of type `DerivedGeneric` in unit tests was not recognized as compiler-generated code after the commit "`Fixed the issue where the DefaultParameters type in https://github.com/restsharp/RestSharp/blob/dev/src/RestSharp/Parameters/DefaultParameters.cs was incorrectly judged as to whether the primary constructor was used due to incorrect initialization logic of isStruct and isInheritedRecord in the constructor of the RecordDecompiler class.`". --- ICSharpCode.Decompiler/CSharp/RecordDecompiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/RecordDecompiler.cs b/ICSharpCode.Decompiler/CSharp/RecordDecompiler.cs index ccefe45be..c52fea6bc 100644 --- a/ICSharpCode.Decompiler/CSharp/RecordDecompiler.cs +++ b/ICSharpCode.Decompiler/CSharp/RecordDecompiler.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.Decompiler.CSharp this.cancellationToken = cancellationToken; this.baseClass = recordTypeDef.DirectBaseTypes.FirstOrDefault(b => b.Kind == TypeKind.Class); this.isStruct = recordTypeDef.Kind == TypeKind.Struct; - var baseClassTypeDef = baseClass as ITypeDefinition; + var baseClassTypeDef = (baseClass is ITypeDefinition def) ? def : (baseClass is ParameterizedType paramT) ? paramT.GenericType as ITypeDefinition : null; this.isInheritedRecord = !isStruct && (baseClassTypeDef?.IsRecord ?? false); this.isSealed = recordTypeDef.IsSealed; DetectAutomaticProperties();