From e5df3970e888ddcb62380f8cd3f08a9aaadddc85 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Tue, 20 Oct 2020 01:54:03 +0300 Subject: [PATCH] Workaround for corert --- .../XamlCompilerTaskExecutor.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs b/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs index 7c4a9df0f4..6b01af2ede 100644 --- a/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs +++ b/src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs @@ -345,6 +345,20 @@ namespace Avalonia.Build.Tasks } res.Remove(); } + + + // Technically that's a hack, but it fixes corert incompatibility caused by deterministic builds + int dupeCounter = 1; + foreach (var grp in typeDef.NestedTypes.GroupBy(x => x.Name)) + { + if (grp.Count() > 1) + { + foreach (var dupe in grp) + dupe.Name += "_dup" + dupeCounter++; + } + } + + return true; }