Allow generic load result

This commit is contained in:
Yoshi Askharoun
2024-12-30 11:24:26 -06:00
parent 1e43ec3257
commit 609325b62c
3 changed files with 11 additions and 6 deletions
+7 -2
View File
@@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Xml.Linq;
namespace Microsoft.Iris.Asm;
@@ -26,7 +25,13 @@ public class Disassembler
};
}
public static Disassembler Load(MarkupLoadResult loadResult) => new(loadResult);
public static Disassembler Load(LoadResult loadResult)
{
if (loadResult is not MarkupLoadResult markupLoadResult)
throw new ArgumentException($"Disassembly can only be performed on markup. Expected '{nameof(MarkupLoadResult)}', got '{loadResult?.GetType().Name}'.");
return new(markupLoadResult);
}
public IEnumerable<Directive> GetExports()
{