Skip to content

Commit 04f2461

Browse files
authored
Merge pull request AngleSharp#1144 from martincostello/fix-aot-warning
Fix AoT warning
2 parents 8efd43c + 1021f23 commit 04f2461

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AngleSharp/Common/ObjectExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ public static Double Constraint(this Double value, Double min, Double max)
166166
/// </summary>
167167
/// <param name="code">A specific error code.</param>
168168
/// <returns>The description of the error.</returns>
169+
#if NET6_0_OR_GREATER
170+
public static String GetMessage<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] T>(this T code)
171+
#else
169172
public static String GetMessage<T>(this T code)
173+
#endif
170174
where T : Enum
171175
{
172176
var field = typeof(T).GetField(code.ToString());

0 commit comments

Comments
 (0)