---
title: "contradictory-interface-assertion"
description: "Detect interface assertions with conflicting method signatures."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# contradictory-interface-assertion

**Default severity:** `error`

An assertion from one interface to another can compile even when the two
method sets contain a same-named method with incompatible signatures. No
dynamic type can implement both contracts, so the assertion can never
succeed.

Assertions to concrete types are already checked by the Go compiler. This
check focuses on interface-to-interface assertions.

## Bad

```go
type source interface { Read() int }
type target interface { Read() string }

value, ok := input.(target) // reported when input has type source
```

## Good

```go
type source interface { Read() int }
type target interface { Write([]byte) error }

value, ok := input.(target)
```

Source: https://strider.gempir.com/analyzers/contradictory-interface-assertion/index.mdx
