@@ -463,18 +463,17 @@ equiv :: Raw -> Elab' aux ()
463463equiv tm = processTactic' (Equiv tm)
464464
465465-- | Turn the current hole into a pattern variable with the provided
466−-- name, made unique if MN
466+-- name, made unique if not the same as the head of the hole queue
467467patvar :: Name -> Elab' aux ()
468468patvar n@(SN _) = do apply (Var n) []; solve
469469patvar n = do env <- get_env
470470 hs <- get_holes
471471 if (n `elem` map fst env) then do apply (Var n) []; solve
472− else do n' <- case n of
473− UN _ -> return $! n
474− MN _ _ -> unique_hole n
475− NS _ _ -> return $! n
476− x -> return $! n
477− processTactic' (PatVar n')
472+ else do n' <- case hs of
473+ (h : hs) -> if n == h then return n
474+ else unique_hole n
475+ _ -> unique_hole n
476+ processTactic' (PatVar n)
478477
479478-- | Turn the current hole into a pattern variable with the provided
480479-- name, but don't make MNs unique.