# M0007 mismatched types (/docs/diagnostics/codes/m0007)

<Diagnostic code="M0007" />

## The mistake and the fix [#the-mistake-and-the-fix]

<div className="code-pair">

```go title="The mistake"
var n int
var f float64
_ = n + f
```

```go title="Fixed"
_ = float64(n) + f // [!code highlight]
```

</div>

## The fix [#the-fix]

Convert one operand to the type of the other.

See also [all error codes](/docs/diagnostics/codes) and [marmot explain](/docs/commands/explain).