Skip to content

Commit

Permalink
Update decompiler submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Jul 14, 2023
1 parent 928b57b commit 395322f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions dnSpy/dnSpy.Contracts.Logic/Decompiler/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,16 @@ public static bool IsIndexer(this PropertyDef? property) {
return false;
}

static string? GetDefaultMemberName(TypeDef type) {
static string? GetDefaultMemberName(TypeDef? type) {
if (type is null)
return null;
foreach (var ca in type.CustomAttributes.FindAll("System.Reflection.DefaultMemberAttribute")) {
if (ca.Constructor is not null && ca.Constructor.FullName == @"System.Void System.Reflection.DefaultMemberAttribute::.ctor(System.String)" &&
ca.ConstructorArguments.Count == 1 &&
ca.ConstructorArguments[0].Value is UTF8String) {
return (UTF8String)ca.ConstructorArguments[0].Value;
ca.ConstructorArguments.Count == 1) {
var value = ca.ConstructorArguments[0].Value;
var memberName = (value as UTF8String)?.String ?? value as string;
if (memberName is not null)
return memberName;
}
}
return null;
Expand Down

0 comments on commit 395322f

Please sign in to comment.