Browse Source

Analyzer: result redirection - don't require that name starts with '<'.

Always attempt redirect if member is compiler generated.
pull/170/head
Ed Harvey 14 years ago
parent
commit
5bf46e3d19
  1. 7
      ILSpy/TreeNodes/Analyzer/Helpers.cs

7
ILSpy/TreeNodes/Analyzer/Helpers.cs

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

Loading…
Cancel
Save