@@ -2658,9 +2658,11 @@ withErrorReflection x = idrisCatch x (\ e -> handle e >>= ierror)
2658 concat (intersperse ", " (map show handlers))
2658 concat (intersperse ", " (map show handlers))
2659 let reports = map (\n -> RApp (Var n) (reflectErr err)) handlers
2659 let reports = map (\n -> RApp (Var n) (reflectErr err)) handlers
2661− -- Typecheck error handlers - if this fails, then something else was wrong earlier!
2661+ -- Typecheck error handlers - if this fails, most
2662+ -- likely something which is needed by it has not
2663+ -- been imported, so keep the original error.
2662 handlers <- case mapM (check (tt_ctxt ist) []) reports of
2664 handlers <- case mapM (check (tt_ctxt ist) []) reports of
2663− Error e -> ierror $ ReflectionFailed "Type error while constructing reflected error" e
2665+ Error _ -> return [] -- ierror $ ReflectionFailed "Type error while constructing reflected error" e
2664 OK hs -> return hs
2666 OK hs -> return hs
2666 -- Normalize error handler terms to produce the new messages
2668 -- Normalize error handler terms to produce the new messages