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

  × semantic: The input argument of `pop` requires a value with type `[any;
  │ 1+]`, but found [any; 0]
   ╭─[2:8]
 1 │ arr = []
 2 │ fail = pop(arr)
   ·        ────┬───┬
   ·            │   ╰── tests/array_elem_pop_empty_fail/input.kcl
   ·            ╰── tests/array_elem_pop_empty_fail/input.kcl
   ╰────
  ╰─▶ KCL Semantic error
      
        × semantic: The input argument of `pop` requires a value with type
        │ `[any; 1+]`, but found [any; 0]
         ╭─[2:12]
       1 │ arr = []
       2 │ fail = pop(arr)
         ·            ─┬─
         ·             ╰── tests/array_elem_pop_empty_fail/input.kcl
         ╰────
