Skip to content

Commit a317504

Browse files
committed
From Agda 2.6.3 use Agda.TypeChecking.Error.explainWhyInScope
`explainWhyInScope` was not exported by `Agda` until 2.6.3, so it had to be duplicated.
1 parent 6b0386c commit a317504

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Agda/Convert.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import Agda.Syntax.Internal (alwaysUnblock)
2222
import Agda.Syntax.Position (HasRange (getRange), Range, noRange)
2323
import Agda.Syntax.Scope.Base
2424
import Agda.TypeChecking.Errors (getAllWarningsOfTCErr, prettyError)
25+
#if MIN_VERSION_Agda(2,6,3)
26+
import Agda.TypeChecking.Errors (explainWhyInScope)
27+
#endif
2528
import Agda.TypeChecking.Monad hiding (Function)
2629
import Agda.TypeChecking.Monad.MetaVars (withInteractionId)
2730
import Agda.TypeChecking.Pretty (prettyTCM)
@@ -259,8 +262,8 @@ fromDisplayInfo = \case
259262
<+> text (List.intercalate ", " $ words names) $$ nest 2 (align 10 hitDocs)
260263
return $ IR.DisplayInfoGeneric "Search About" [Unlabeled (Render.text $ show doc) Nothing Nothing]
261264
#if MIN_VERSION_Agda(2,6,3)
262-
Info_WhyInScope (WhyInScopeData q cwd v xs ms) -> do
263-
doc <- explainWhyInScope (prettyShow q) cwd v xs ms
265+
Info_WhyInScope why -> do
266+
doc <- explainWhyInScope why
264267
#else
265268
Info_WhyInScope s cwd v xs ms -> do
266269
doc <- explainWhyInScope s cwd v xs ms
@@ -380,6 +383,7 @@ showInfoError (Info_HighlightingParseError ii) =
380383
showInfoError (Info_HighlightingScopeCheckError ii) =
381384
return $ "Highlighting failed to scope check expression in " ++ show ii
382385

386+
#if !MIN_VERSION_Agda(2,6,3)
383387
explainWhyInScope ::
384388
String ->
385389
FilePath ->
@@ -462,6 +466,7 @@ explainWhyInScope s _ v xs ms =
462466
TCP.<+> "at"
463467
TCP.<+> TCP.prettyTCM (getRange m)
464468
TCP.$$ pWhy r w
469+
#endif
465470

466471
-- | Pretty-prints the context of the given meta-variable.
467472
prettyResponseContexts ::

0 commit comments

Comments
 (0)