@@ -1258,28 +1258,29 @@ void CreateClassOrStructComparer()
12581258 foreach ( FieldDefinition fieldDef in dataTr . FindAllSerializableFields ( Session , null , WriterProcessor . EXCLUDED_ASSEMBLY_PREFIXES ) )
12591259 {
12601260 FieldReference fr = ImportReference ( fieldDef ) ;
1261- MethodDefinition recursiveMd = CreateEqualityComparer ( fieldDef . FieldType ) ;
1261+ TypeReference fieldTypeRef = ImportReference ( fieldDef . FieldType ) ;
1262+ MethodDefinition recursiveMd = CreateEqualityComparer ( fieldTypeRef ) ;
12621263 if ( recursiveMd == null )
12631264 break ;
12641265 processor . Append ( GetLoadParameterInstruction ( comparerMd , v0Pd ) ) ;
12651266 processor . Emit ( OpCodes . Ldfld , fr ) ;
12661267 processor . Append ( GetLoadParameterInstruction ( comparerMd , v1Pd ) ) ;
12671268 processor . Emit ( OpCodes . Ldfld , fr ) ;
1268- FinishTypeReferenceCompare ( fieldDef . FieldType ) ;
1269+ FinishTypeReferenceCompare ( fieldTypeRef ) ;
12691270 }
12701271
12711272 // Properties.
12721273 foreach ( PropertyDefinition propertyDef in dataTr . FindAllSerializableProperties ( Session , null , WriterProcessor . EXCLUDED_ASSEMBLY_PREFIXES ) )
12731274 {
12741275 MethodReference getMr = Module . ImportReference ( propertyDef . GetMethod ) ;
1275- MethodDefinition recursiveMd = CreateEqualityComparer ( getMr . ReturnType ) ;
1276+ MethodDefinition recursiveMd = CreateEqualityComparer ( ImportReference ( getMr . ReturnType ) ) ;
12761277 if ( recursiveMd == null )
12771278 break ;
12781279 processor . Append ( GetLoadParameterInstruction ( comparerMd , v0Pd ) ) ;
12791280 processor . Emit ( OpCodes . Call , getMr ) ;
12801281 processor . Append ( GetLoadParameterInstruction ( comparerMd , v1Pd ) ) ;
12811282 processor . Emit ( OpCodes . Call , getMr ) ;
1282- FinishTypeReferenceCompare ( propertyDef . PropertyType ) ;
1283+ FinishTypeReferenceCompare ( ImportReference ( propertyDef . PropertyType ) ) ;
12831284 }
12841285
12851286 // Return true;
0 commit comments