@@ -14,7 +14,7 @@ import Idris.Core.Elaborate hiding (Tactic(..))
14import Idris.Core.TT
14import Idris.Core.TT
15import Idris.Core.Evaluate
15import Idris.Core.Evaluate
16import Idris.Core.Unify
16import Idris.Core.Unify
17−import Idris.Core.Typecheck (check)
17+import Idris.Core.Typecheck (check, recheck)
18import Idris.ErrReverse (errReverse)
18import Idris.ErrReverse (errReverse)
19import Idris.ElabQuasiquote (extractUnquotes)
19import Idris.ElabQuasiquote (extractUnquotes)
@@ -729,12 +729,16 @@ elab ist info emode opts fn tm
729 -- original goal in the original proof state.
729 -- original goal in the original proof state.
730 env <- get_env
730 env <- get_env
731 loadState
731 loadState
732− case fmap (explicitNames . binderVal) $ lookup nTm env of
732+ let quoted = fmap (explicitNames . binderVal) $ lookup nTm env
735+ Just q -> do ctxt <- get_context
736+ (q', _, _) <- lift $ recheck ctxt [(uq, Lam Erased) | uq <- unquoteNames] (forget q) q
734− | pattern -> reflectQuotePattern unquoteNames q
738+ then reflectQuotePattern unquoteNames q'
735− | otherwise -> do fill $ reflectQuote unquoteNames q
739+ else do fill $ reflectQuote unquoteNames q'
737− Nothing -> fail "Broken elaboration of quasiquote"
741+ Nothing -> lift . tfail . Msg $ "Broken elaboration of quasiquote"
739 -- Finally fill in the terms or patterns from the unquotes. This
743 -- Finally fill in the terms or patterns from the unquotes. This
740 -- happens last so that their holes still exist while elaborating
744 -- happens last so that their holes still exist while elaborating