---
source: kcl/src/simulation_tests.rs
description: Error from executing invalid_index_negative.kcl
---
KCL Semantic error

  × semantic: '-1' is negative, so you can't index an array with it
   ╭─[3:5]
 2 │ i = -1
 3 │ x = arr[i]
   ·     ───┬──
   ·        ╰── tests/invalid_index_negative/input.kcl
   ╰────
