@@ -305,7 +305,7 @@ public override IEnumerable<MethodDesc> GetMethods()
305305 {
306306 foreach ( var handle in _typeDefinition . GetMethods ( ) )
307307 {
308- yield return ( EcmaMethod ) _module . GetObject ( handle ) ;
308+ yield return _module . GetMethod ( handle , this ) ;
309309 }
310310 }
311311
@@ -316,7 +316,7 @@ public override IEnumerable<MethodDesc> GetVirtualMethods()
316316 {
317317 MethodDefinition methodDef = reader . GetMethodDefinition ( handle ) ;
318318 if ( ( methodDef . Attributes & MethodAttributes . Virtual ) != 0 )
319- yield return ( EcmaMethod ) _module . GetObject ( handle ) ;
319+ yield return _module . GetMethod ( handle , this ) ;
320320 }
321321 }
322322
@@ -329,7 +329,7 @@ public override MethodDesc GetMethod(string name, MethodSignature signature, Ins
329329 {
330330 if ( stringComparer . Equals ( metadataReader . GetMethodDefinition ( handle ) . Name , name ) )
331331 {
332- var method = ( EcmaMethod ) _module . GetObject ( handle ) ;
332+ var method = _module . GetMethod ( handle , this ) ;
333333 if ( signature == null || signature . Equals ( method . Signature . ApplySubstitution ( substitution ) ) )
334334 return method ;
335335 }
@@ -349,7 +349,7 @@ public override MethodDesc GetStaticConstructor()
349349 if ( methodDefinition . Attributes . IsRuntimeSpecialName ( ) &&
350350 stringComparer . Equals ( methodDefinition . Name , ".cctor" ) )
351351 {
352- var method = ( EcmaMethod ) _module . GetObject ( handle ) ;
352+ var method = _module . GetMethod ( handle , this ) ;
353353 return method ;
354354 }
355355 }
@@ -372,7 +372,7 @@ public override MethodDesc GetDefaultConstructor()
372372 if ( attributes . IsRuntimeSpecialName ( ) && attributes . IsPublic ( )
373373 && stringComparer . Equals ( methodDefinition . Name , ".ctor" ) )
374374 {
375- var method = ( EcmaMethod ) _module . GetObject ( handle ) ;
375+ var method = _module . GetMethod ( handle , this ) ;
376376 MethodSignature sig = method . Signature ;
377377
378378 if ( sig . Length != 0 )
@@ -424,7 +424,7 @@ public override IEnumerable<FieldDesc> GetFields()
424424 {
425425 foreach ( var handle in _typeDefinition . GetFields ( ) )
426426 {
427- var field = ( EcmaField ) _module . GetObject ( handle ) ;
427+ var field = _module . GetField ( handle , this ) ;
428428 yield return field ;
429429 }
430430 }
@@ -438,7 +438,7 @@ public override TypeDesc UnderlyingType
438438
439439 foreach ( var handle in _typeDefinition . GetFields ( ) )
440440 {
441- var field = ( EcmaField ) _module . GetObject ( handle ) ;
441+ var field = _module . GetField ( handle , this ) ;
442442 if ( ! field . IsStatic )
443443 return field . FieldType ;
444444 }
@@ -456,7 +456,7 @@ public override FieldDesc GetField(string name)
456456 {
457457 if ( stringComparer . Equals ( metadataReader . GetFieldDefinition ( handle ) . Name , name ) )
458458 {
459- var field = ( EcmaField ) _module . GetObject ( handle ) ;
459+ var field = _module . GetField ( handle , this ) ;
460460 return field ;
461461 }
462462 }
@@ -560,7 +560,7 @@ public override ClassLayoutMetadata GetClassLayout()
560560 // Note: GetOffset() returns -1 when offset was not set in the metadata
561561 int specifiedOffset = fieldDefinition . GetOffset ( ) ;
562562 result . Offsets [ index ] =
563- new FieldAndOffset ( ( EcmaField ) _module . GetObject ( handle ) , specifiedOffset == - 1 ? FieldAndOffset . InvalidOffset : new LayoutInt ( specifiedOffset ) ) ;
563+ new FieldAndOffset ( _module . GetField ( handle , this ) , specifiedOffset == - 1 ? FieldAndOffset . InvalidOffset : new LayoutInt ( specifiedOffset ) ) ;
564564
565565 index ++ ;
566566 }
0 commit comments