> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sifr.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# SIFR-PROTO-0005: Protocol receiver convention mismatch.

> Protocol receiver convention mismatch.

`SIFR-PROTO-0005` belongs to the **Protocols** diagnostic family. It means: protocol receiver convention mismatch.

## Why It Happens

A value does not satisfy the structural protocol required by the operation, such as iteration, context management, or indexing.

<Info>
  Use `sifr --explain SIFR-PROTO-0005` locally to see the renderer's exact message template and any machine-applicable suggestions for the compiler version you are running.
</Info>

## Erroneous Code

```python theme={null}
class Readable(Protocol):
    def update(self) -> None:
        pass

class Counter:
    value: int

    def update(self) -> None:
        self.value += 1
```

## How To Fix It

Declare a mutable receiver in the protocol when conforming implementations may
mutate their receiver.

## Fixed Code

```python theme={null}
class Updatable(Protocol):
    def update(mut self) -> None:
        pass

class Counter:
    value: int

    def update(self) -> None:
        self.value += 1
```

## Details

| Field                  | Value                                                                   |
| ---------------------- | ----------------------------------------------------------------------- |
| Code                   | `SIFR-PROTO-0005`                                                       |
| Family                 | `PROTO`                                                                 |
| Severity               | Error                                                                   |
| Stability              | stable                                                                  |
| Owner                  | `sifr_lowering::lower::method_receiver_analysis`                        |
| Representative fixture | `crates/sifr/tests/e2e/fail/protocol_receiver_mutability_mismatch.sifr` |

See the [Error Codes index](/diagnostics/error-codes) for the complete catalog.
