I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe the compiler guesses the wrong type?)
['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/']
It won't cause any "issues", regarding code however you could have a regression issue...

```
IObject1
{
    void DoSomething();
}

IObject2
{
    void DoSomething();
}

var result = SomeMethod();
result.DoSomething();

```

Now, if SomeMethod returned IObject1 and then was changed to return IObject2 this would still compile. ***However***, if you expect DoSomething to execute particular code then this could potentially be a regression issue.

However, if you have

```
IObject1 result = SomeMethod();

```

If the return type of SomeMethod is changed you'll know it right away.
```
var x = 0
x = 0.10

```

`Cannot convert source type 'double' to target type 'int'`

An example:

```
double x = 0; //to initialize it
switch (something) {
    case condition1:
        x = 0.1;
        break;
    case condition2:
        x = 0.2;
        break;
}

```

Using `var` instead of `double` will give a compiler error.