Browse Source

Fix bug in UnknownType: FullName of nested unknown types did not contain the outer type name(s), but only namespace and nested type name.

pull/3092/head
Siegfried Pammer 1 year ago
parent
commit
2e777201f3
  1. 16
      ICSharpCode.Decompiler/TypeSystem/FullTypeName.cs
  2. 4
      ICSharpCode.Decompiler/TypeSystem/Implementation/UnknownType.cs

16
ICSharpCode.Decompiler/TypeSystem/FullTypeName.cs

@ -165,6 +165,22 @@ namespace ICSharpCode.Decompiler.TypeSystem
} }
} }
public string FullName {
get {
if (nestedTypes == null)
return topLevelType.Namespace + "." + topLevelType.Name;
StringBuilder b = new StringBuilder(topLevelType.Namespace);
b.Append('.');
b.Append(topLevelType.Name);
foreach (NestedTypeName nt in nestedTypes)
{
b.Append('.');
b.Append(nt.Name);
}
return b.ToString();
}
}
/// <summary> /// <summary>
/// Gets the total type parameter count. /// Gets the total type parameter count.
/// </summary> /// </summary>

4
ICSharpCode.Decompiler/TypeSystem/Implementation/UnknownType.cs

@ -95,6 +95,10 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return namespaceKnown ? fullTypeName.ReflectionName : "?"; } get { return namespaceKnown ? fullTypeName.ReflectionName : "?"; }
} }
public override string FullName {
get { return namespaceKnown ? fullTypeName.FullName : "?"; }
}
public FullTypeName FullTypeName => fullTypeName; public FullTypeName FullTypeName => fullTypeName;
public override int TypeParameterCount => fullTypeName.TypeParameterCount; public override int TypeParameterCount => fullTypeName.TypeParameterCount;

Loading…
Cancel
Save