From 6e497fbe966f99b1fe3c5e5309f91b4ab20537e3 Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Thu, 26 Feb 2026 18:18:32 +0000 Subject: [PATCH] Support ExperimentalAttribute in XAML (#20765) --- external/XamlX | 2 +- .../CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/external/XamlX b/external/XamlX index c32d3040e5..009d481547 160000 --- a/external/XamlX +++ b/external/XamlX @@ -1 +1 @@ -Subproject commit c32d3040e536ae9768233ea5a445697632578bd0 +Subproject commit 009d4815470cf4bf71d1adbb633a5d81dcb2bb52 diff --git a/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs b/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs index 146bb5347a..ae12c9aca7 100644 --- a/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs +++ b/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs @@ -40,9 +40,9 @@ internal static class AvaloniaXamlDiagnosticCodes // Reserved 5000-9998 public const string Obsolete = "AVLN5001"; - internal static string XamlXDiagnosticCodeToAvalonia(object xamlException) + internal static string XamlXDiagnosticCodeToAvalonia(object codeOrException) { - return xamlException switch + return codeOrException switch { XamlXWellKnownDiagnosticCodes wellKnownDiagnosticCodes => wellKnownDiagnosticCodes switch { @@ -50,6 +50,9 @@ internal static class AvaloniaXamlDiagnosticCodes _ => throw new ArgumentOutOfRangeException() }, + // ExperimentalAttribute reports its own code + string code => code, + XamlDataContextException => DataContextResolvingError, XamlBindingsTransformException => BindingsError, XamlPropertyPathException => PropertyPathError,