Skip to content

Commit

Permalink
#2 Remove warnings about "possible multiple enumeration"
Browse files Browse the repository at this point in the history
  • Loading branch information
sguldmund committed Jan 12, 2024
1 parent 7575f83 commit 241a2e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Pose/Helpers/ShimHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ public static void ValidateReplacementMethodSignature(MethodBase original, Metho
var shimOwningType = isStaticOrConstructor
? validOwningType : replacement.GetParameters().Select(p => p.ParameterType).FirstOrDefault();

var validParameterTypes = original.GetParameters().Select(p => p.ParameterType);
var validParameterTypes = original.GetParameters().Select(p => p.ParameterType).ToArray();
var shimParameterTypes = replacement.GetParameters()
.Select(p => p.ParameterType)
.Skip(isStaticOrConstructor ? 0 : 1);
.Skip(isStaticOrConstructor ? 0 : 1)
.ToArray();

if (vaildReturnType != shimReturnType)
throw new InvalidShimSignatureException("Mismatched return types");
Expand Down

0 comments on commit 241a2e3

Please sign in to comment.