@@ -450,8 +450,9 @@ pushIndent = do pos <- position
450450-- | Pops indentation from stack
451451popIndent :: IdrisParser ()
452452popIndent = do ist <- get
453− let (x : xs) = indent_stack ist
454− put (ist { indent_stack = xs })
453+ case indent_stack ist of
454+ [] -> error "The impossible happened! Tried to pop an indentation level where none was pushed (underflow)."
455+ (x : xs) -> put (ist { indent_stack = xs })
455456
456457
457458-- | Gets current indentation