# P0002

Index out of bounds: `List.at` was given an index below 0 or not below the list's length. Spans the call.

**Machine-applicable fix:** none.

## Example

This program fails with `P0002`.

```oska
fn main() {
    let xs: List<Int> = List.new()
    let first = xs.at(0)
}
```

## Fixed

The same program, fixed.

```oska
fn main() {
    let xs: List<Int> = List.new()
    let first = xs.get(0)
}
```

Listed in the [runtime notes](/runtime.md#p0002). `oskac explain P0002` prints this entry offline.