The requested page is not available for the requested platform. You are viewing the content for Default platform.

Remove Redundant Type Specification

Removes redundant type specifications from lambda expression parameters.

Availability

Available from the context menu or via shortcuts:

  • when the cursor is somewhere within a lambda expression parameters list.

Examples

private static void X(Action<int, int, int> action)
{

}
static void Main(string[] args)
{
    X((int a, int b, int c) => 
    { 
        int x = a + b + c; 
    });
}
Private Shared Sub X(ByVal action As Action(Of Integer, Integer, Integer))

End Sub
Private Shared Sub Main(ByVal args As String())
    X(Function(a As Integer, b As Integer, c As Integer) a + b + c)
End Sub

Result:

private static void X(Action<int, int, int> action)
{

}
static void Main(string[] args)
{
    X((a, b, c) =>
        {
            int x = a + b + c;
        });
}
Private Shared Sub X(ByVal action As Action(Of Integer, Integer, Integer))

End Sub
Private Shared Sub Main(ByVal args As String())
    X(Function(a, b, c) a + b + c)
End Sub

Screenshot

rsRemoveRedundantTypeSpecification