Skip to main content
A newer version of this page is available. .

Make Implicit/Explicit

Purpose

Converts an explicitly-typed variable declaration to an implicit one and vice versa. You can use implicitly typed variables to avoid redundancy and increase code readability. On the other hand, the explicit typing helps to avoid mistakes.

Availability

Available when the caret is on a variable declaration.

Usage

  1. Place the caret to a variable declaration.

    NOTE

    The blinking cursor shows the caret's position at which the Refactoring is available.

    var i = 10;
    
  2. Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu.
  3. Select Make Explicit from the menu (Make Implicit if the variable is declared explicitly).

After execution, the Refactoring changes the variable type to implicit or changes the implicit type to the most suitable explicit type.

int i = 10;
NOTE

This feature is available as a part of Code Cleanup.

See Also