From c8e7502d4ee5a9e81ae129c52aeb34403bcc2de9 Mon Sep 17 00:00:00 2001 From: martincostello Date: Sat, 28 Oct 2023 10:41:24 +0100 Subject: [PATCH] Resolve IL2091 warnings Resolve two AoT warnings on `OutcomePipelineBuilderExtensions`. Relates to #1732. --- .../Outcomes/OutcomePipelineBuilderExtensions.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Polly.Core/Simmy/Outcomes/OutcomePipelineBuilderExtensions.cs b/src/Polly.Core/Simmy/Outcomes/OutcomePipelineBuilderExtensions.cs index 433ffb81487..f0f9b917af9 100644 --- a/src/Polly.Core/Simmy/Outcomes/OutcomePipelineBuilderExtensions.cs +++ b/src/Polly.Core/Simmy/Outcomes/OutcomePipelineBuilderExtensions.cs @@ -16,7 +16,10 @@ internal static class OutcomePipelineBuilderExtensions /// The injection rate for a given execution, which the value should be between [0, 1] (inclusive). /// The outcome to inject. For disposable outcomes use either the generator or the options overload. /// The builder instance with the retry strategy added. - public static ResiliencePipelineBuilder AddChaosResult(this ResiliencePipelineBuilder builder, double injectionRate, TResult result) + public static ResiliencePipelineBuilder AddChaosResult<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TResult>( + this ResiliencePipelineBuilder builder, + double injectionRate, + TResult result) { Guard.NotNull(builder); @@ -37,8 +40,10 @@ public static ResiliencePipelineBuilder AddChaosResult(this Re /// The injection rate for a given execution, which the value should be between [0, 1] (inclusive). /// The outcome generator delegate. /// The builder instance with the retry strategy added. - public static ResiliencePipelineBuilder AddChaosResult( - this ResiliencePipelineBuilder builder, double injectionRate, Func resultGenerator) + public static ResiliencePipelineBuilder AddChaosResult<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TResult>( + this ResiliencePipelineBuilder builder, + double injectionRate, + Func resultGenerator) { Guard.NotNull(builder);