@@ -228,8 +228,6 @@ private Instruction InjectCacheKeyCreatedCode(MethodDefinition methodDefinition,
228228 if ( LogDebugOutput )
229229 {
230230 // Call Debug.WriteLine with CacheKey
231- TypeReference debug = methodDefinition . Module . TypeReferenceFromCorlib ( typeof ( Debug ) . FullName ) ;
232-
233231 current =
234232 current . AppendLdstr ( processor , "CacheKey created: {0}" )
235233 . AppendLdcI4 ( processor , 1 )
@@ -422,7 +420,7 @@ private bool ShouldWeaveMethod(MethodDefinition method)
422420 bool hasMethodLevelCache = method . ContainsAttribute ( CacheAttributeName ) ;
423421 bool hasNoCacheAttribute = method . ContainsAttribute ( NoCacheAttributeName ) ;
424422 bool isSpecialName = method . IsSpecialName || method . IsGetter || method . IsSetter || method . IsConstructor ;
425- bool isCompilerGenerated = method . ContainsAttribute ( typeof ( CompilerGeneratedAttribute ) ) ;
423+ bool isCompilerGenerated = method . ContainsAttribute ( References . CompilerGeneratedAttribute ) ;
426424
427425 if ( hasNoCacheAttribute || isSpecialName || isCompilerGenerated )
428426 {
@@ -455,10 +453,10 @@ private bool ShouldWeaveProperty(PropertyDefinition property)
455453 bool hasNoCacheAttribute = property . ContainsAttribute ( NoCacheAttributeName ) ;
456454 bool isCacheGetter = property . Name == CacheGetterName ;
457455 bool hasGetAccessor = property . GetMethod != null ;
458- bool hasSetAccessor = property . GetMethod != null ;
456+ bool hasSetAccessor = property . SetMethod != null ;
459457 bool isAutoProperty = hasGetAccessor && hasSetAccessor &&
460- property . GetMethod . ContainsAttribute ( typeof ( CompilerGeneratedAttribute ) ) &&
461- property . SetMethod . ContainsAttribute ( typeof ( CompilerGeneratedAttribute ) ) ;
458+ property . GetMethod . ContainsAttribute ( References . CompilerGeneratedAttribute ) &&
459+ property . SetMethod . ContainsAttribute ( References . CompilerGeneratedAttribute ) ;
462460
463461 if ( hasNoCacheAttribute || isCacheGetter || isAutoProperty || ! hasGetAccessor )
464462 {
@@ -593,7 +591,7 @@ private void WeaveMethod(MethodDefinition methodDefinition)
593591 return ;
594592 }
595593
596- if ( methodDefinition . ReturnType . FullName == methodDefinition . Module . ImportType ( typeof ( void ) ) . FullName )
594+ if ( methodDefinition . ReturnType == methodDefinition . Module . TypeSystem . Void )
597595 {
598596 LogWarning ( string . Format ( "Method {0} returns void. Skip weaving of method {0}." , methodDefinition . Name ) ) ;
599597
0 commit comments