Skip to content

Commit

Permalink
Fix bug in UnknownType: FullName of nested unknown types did not cont…
Browse files Browse the repository at this point in the history
…ain the outer type name(s), but only namespace and nested type name.
  • Loading branch information
siegfriedpammer committed Mar 15, 2024
1 parent 661c411 commit a39fab6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ICSharpCode.Decompiler/TypeSystem/FullTypeName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,22 @@ public string ReflectionName {
}
}

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>
/// Gets the total type parameter count.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public override string ReflectionName {
get { return namespaceKnown ? fullTypeName.ReflectionName : "?"; }
}

public override string FullName {
get { return namespaceKnown ? fullTypeName.FullName : "?"; }
}

public FullTypeName FullTypeName => fullTypeName;

public override int TypeParameterCount => fullTypeName.TypeParameterCount;
Expand Down

0 comments on commit a39fab6

Please sign in to comment.