File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,10 @@ public static class TaskExtensions
26
26
/// and uses reflection to access the <see cref="Task{TResult}.Result"/> property and boxes the result if it's
27
27
/// a value type, which adds overhead. It should only be used when using generics is not possible.
28
28
/// </remarks>
29
- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
30
- public static object ? GetResultOrDefault (
31
29
#if NET6_0_OR_GREATER
32
- [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicProperties ) ]
30
+ [ RequiresUnreferencedCode ( "This method uses reflection to try to access the Task<T>.Result property of the input Task instance." ) ]
33
31
#endif
34
- this Task task )
32
+ public static object ? GetResultOrDefault ( this Task task )
35
33
{
36
34
// Check if the instance is a completed Task
37
35
if (
Original file line number Diff line number Diff line change 36
36
37
37
<!-- Enable trimming support on .NET 6 -->
38
38
<PropertyGroup Condition =" '$(TargetFramework)' == 'net6.0'" >
39
- <EnableTrimAnalyzer >true</EnableTrimAnalyzer >
39
+
40
+ <!-- Temporarily disabled as a workaround for https://github.com/dotnet/linker/issues/3032 -->
41
+ <EnableTrimAnalyzer >false</EnableTrimAnalyzer >
40
42
<IsTrimmable >true</IsTrimmable >
41
43
</PropertyGroup >
42
44
You can’t perform that action at this time.
0 commit comments