Skip to content

IDE0008 (Use explicit type) Fix All operation is too broad #38953

Open
@sharwell

Description

Version Used: Visual Studio 16.4 Preview 1

Steps to Reproduce:

csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = false:silent
class ClassName
{
  void Method()
  {
    var x = new object();
    var y = 0;
  }
}

Apply Fix All in Solution for the warning reported on var y.

Expected Behavior:

class ClassName
{
  void Method()
  {
    var x = new object();
    int y = 0;
  }
}

Actual Behavior:

class ClassName
{
  void Method()
  {
    object x = new object();
    int y = 0;
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      Complete
    • Status

      InQueue

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions