From 274cb2c5b440a08ae52f0f53c0123e84f39f5fa8 Mon Sep 17 00:00:00 2001 From: Malware Date: Sat, 4 Aug 2018 20:26:19 +0200 Subject: [PATCH] Fixed minifier crash due to missing support for delegate declarations --- Source/MDK/Build/AnalysisExtensions.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/MDK/Build/AnalysisExtensions.cs b/Source/MDK/Build/AnalysisExtensions.cs index 47605b1..14d67d7 100644 --- a/Source/MDK/Build/AnalysisExtensions.cs +++ b/Source/MDK/Build/AnalysisExtensions.cs @@ -133,6 +133,14 @@ public static string GetFullName(this MemberDeclarationSyntax declaration, Decla return eventDeclaration.Identifier.ToString(); } + if (declaration is DelegateDeclarationSyntax delegateDeclaration) + { + var parentName = GetFullName(delegateDeclaration.Parent as MemberDeclarationSyntax); + if (parentName != null) + return $"{parentName}.{delegateDeclaration.Identifier}"; + return delegateDeclaration.Identifier.ToString(); + } + throw new ArgumentException("Do not understand the declaration type", nameof(declaration)); }