> ## 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-CLASS-0004: Missing class field.

> Missing class field.

`SIFR-CLASS-0004` belongs to the **Classes and declarations** diagnostic family. It means: missing class field.

## Why It Happens

The class declaration cannot be lowered into a safe Rust-backed representation. Check field initialization, methods, inheritance constraints, and constructor shape.

<Info>
  Use `sifr --explain SIFR-CLASS-0004` 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 User:
    name: str

user = User()
```

## How To Fix It

Give class declarations a shape the compiler can lower: initialized fields, valid bases, unique variants, and supported field ordering.

## Fixed Code

```python theme={null}
class User:
    name: str

    def __init__(self, name: str):
        self.name = name

user = User("Ada")
```

## Details

| Field                  | Value                                           |
| ---------------------- | ----------------------------------------------- |
| Code                   | `SIFR-CLASS-0004`                               |
| Family                 | `CLASS`                                         |
| Severity               | Error                                           |
| Stability              | stable                                          |
| Owner                  | `sifr_lowering::lower::expressions`             |
| Representative fixture | `crates/sifr/tests/e2e/fail/missing_field.sifr` |

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