|
|
@ -63,8 +63,8 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer |
|
|
|
|
|
|
|
|
|
|
|
public static MethodDefinition GetOriginalCodeLocation(MethodDefinition method) |
|
|
|
public static MethodDefinition GetOriginalCodeLocation(MethodDefinition method) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (method.Name.StartsWith("<", StringComparison.Ordinal) && method.IsCompilerGenerated()) { |
|
|
|
if (method.IsCompilerGenerated()) { |
|
|
|
return FindMethodUsageInType(method.DeclaringType, method); |
|
|
|
return FindMethodUsageInType(method.DeclaringType, method) ?? method; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var typeUsage = GetOriginalCodeLocation(method.DeclaringType, method); |
|
|
|
var typeUsage = GetOriginalCodeLocation(method.DeclaringType, method); |
|
|
@ -73,8 +73,7 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer |
|
|
|
} |
|
|
|
} |
|
|
|
public static MethodDefinition GetOriginalCodeLocation(TypeDefinition type, MethodDefinition method) |
|
|
|
public static MethodDefinition GetOriginalCodeLocation(TypeDefinition type, MethodDefinition method) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (type != null && type.DeclaringType != null && |
|
|
|
if (type != null && type.DeclaringType != null && type.IsCompilerGenerated()) { |
|
|
|
type.Name.StartsWith("<", StringComparison.Ordinal) && type.IsCompilerGenerated()) { |
|
|
|
|
|
|
|
MethodDefinition constructor = GetTypeConstructor(type); |
|
|
|
MethodDefinition constructor = GetTypeConstructor(type); |
|
|
|
return FindMethodUsageInType(type.DeclaringType, constructor); |
|
|
|
return FindMethodUsageInType(type.DeclaringType, constructor); |
|
|
|
} |
|
|
|
} |
|
|
|