> ## 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-0005: Invalid class base.

> Invalid class base.

`SIFR-CLASS-0005` belongs to the **Classes and declarations** diagnostic family. It means: invalid class base.

## 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-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 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-0005`                                      |
| Family                 | `CLASS`                                                |
| Severity               | Error                                                  |
| Stability              | stable                                                 |
| Owner                  | `sifr_lowering::lower::classes`                        |
| Representative fixture | `crates/sifr/tests/e2e/fail/class_unknown_parent.sifr` |

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