diff --git a/src/Avalonia.Build.Tasks/ComInteropHelper.cs b/src/Avalonia.Build.Tasks/ComInteropHelper.cs
index 007231417d..c990741e1e 100644
--- a/src/Avalonia.Build.Tasks/ComInteropHelper.cs
+++ b/src/Avalonia.Build.Tasks/ComInteropHelper.cs
@@ -65,10 +65,8 @@ namespace Avalonia.Build.Tasks
{
Instruction instruction = instructions[i];
- if (instruction.OpCode == OpCodes.Call && instruction.Operand is MethodReference)
+ if (instruction.OpCode == OpCodes.Call && instruction.Operand is MethodReference methodDescription)
{
- var methodDescription = (MethodReference)instruction.Operand;
-
if (methodDescription.Name.StartsWith("Calli") && methodDescription.DeclaringType.Name == "LocalInterop")
{
var callSite = new CallSite(methodDescription.ReturnType) { CallingConvention = MethodCallingConvention.StdCall };
diff --git a/src/Avalonia.Controls/PullToRefresh/ScrollViewerIRefreshInfoProviderAdapter.cs b/src/Avalonia.Controls/PullToRefresh/ScrollViewerIRefreshInfoProviderAdapter.cs
index c3aebc82c5..844973bd28 100644
--- a/src/Avalonia.Controls/PullToRefresh/ScrollViewerIRefreshInfoProviderAdapter.cs
+++ b/src/Avalonia.Controls/PullToRefresh/ScrollViewerIRefreshInfoProviderAdapter.cs
@@ -197,12 +197,12 @@ namespace Avalonia.Controls.PullToRefresh
throw new ArgumentException(nameof(_scrollViewer), "Adaptee's content property must be a Visual");
}
- if (content.Parent is not InputElement)
+ if (content.Parent is not InputElement parent)
{
throw new ArgumentException(nameof(_scrollViewer), "Adaptee's content parent must be an InputElement");
}
- MakeInteractionSource(content.Parent as InputElement);
+ MakeInteractionSource(parent);
if (_scrollViewer != null)
{
diff --git a/src/Avalonia.Controls/Templates/FuncTreeDataTemplate`1.cs b/src/Avalonia.Controls/Templates/FuncTreeDataTemplate`1.cs
index d4ecdd6cf0..a093d976f7 100644
--- a/src/Avalonia.Controls/Templates/FuncTreeDataTemplate`1.cs
+++ b/src/Avalonia.Controls/Templates/FuncTreeDataTemplate`1.cs
@@ -59,7 +59,7 @@ namespace Avalonia.Controls.Templates
/// The untyped function.
private static Func