From 6774c2404c9fc0ac4d46695795563b2dec69f1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Thu, 26 Jun 2025 02:42:24 -0700 Subject: [PATCH] Do not assert IsSupported in DefaultValueAttribute ctor We have defined behaviors for this. We have tests that test the defined behaviors. I guess I'm the first person to run those tests with a Debug version of CoreLib and hit the assert. (Libraries testing typically uses Release runtime but the only time I build Release runtime is for perf testing.) --- .../src/System/ComponentModel/DefaultValueAttribute.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/ComponentModel/DefaultValueAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/ComponentModel/DefaultValueAttribute.cs index f36cd0d0544803..d10102a150732c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ComponentModel/DefaultValueAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ComponentModel/DefaultValueAttribute.cs @@ -39,7 +39,6 @@ public DefaultValueAttribute( // The null check and try/catch here are because attributes should never throw exceptions. // We would fail to load an otherwise normal class. - Debug.Assert(IsSupported, "Runtime instantiation of this attribute is not allowed with trimming."); if (!IsSupported) { _value = s_throwSentinel;