1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Run resolution errors with a specialized handler.

This commit is contained in:
Rob Rix 2018-05-06 16:30:29 -04:00
parent 1f0bc214e6
commit 0dedd68188
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,7 @@ module Data.Abstract.Evaluatable
, LoadError(..)
, runLoadError
, ResolutionError(..)
, runResolutionError
, variable
, evaluateInScopedEnv
, evaluatePackageWith
@ -97,6 +98,9 @@ instance Eq1 ResolutionError where
liftEq _ (GoImportError a) (GoImportError b) = a == b
liftEq _ _ _ = False
runResolutionError :: Evaluator location term value (Resumable ResolutionError ': effects) a -> Evaluator location term value effects (Either (SomeExc ResolutionError) a)
runResolutionError = raiseHandler runError
-- | An error thrown when loading a module from the list of provided modules. Indicates we weren't able to find a module with the given name.
data LoadError term resume where
LoadError :: ModulePath -> LoadError term [Module term]

View File

@ -37,7 +37,7 @@ justEvaluating
. runLoadError
. erroring @(ValueError Precise (Value Precise))
. runUnspecialized
. erroring @ResolutionError
. runResolutionError
. erroring @(EvalError (Value Precise))
. runAddressError
@ -58,7 +58,7 @@ checking
. providingLiveSet
. runLoadError
. runUnspecialized
. erroring @ResolutionError
. runResolutionError
. erroring @(EvalError (Type Monovariant))
. runAddressError
. typeChecking