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