Skip to content

Commit 27b0eb6

Browse files
committed
Update runtime calls with prof/new errors
1 parent e5b68f7 commit 27b0eb6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Share/Backend.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ import Unison.Util.Pretty (Width)
9393
import Unison.Util.Pretty qualified as Pretty
9494
import Unison.Util.SyntaxText qualified as UST
9595
import Unison.Var (Var)
96+
import Unison.Codebase.Runtime.Profile (ProfileSpec (..))
9697

9798
mkTypeDefinitionsOf ::
9899
(QueryM m) =>
@@ -328,16 +329,18 @@ evalDocRef codebase (CodebaseRuntime {codeLookup, codeCache, cachedEvalResult, u
328329
eval (Term.amap (const mempty) -> tm) = PG.transactionSpan "eval" mempty do
329330
-- We use an empty ppe for evalutation, it's only used for adding additional context to errors.
330331
let evalPPE = PPE.empty
331-
termRef <- fmap eitherToMaybe . PG.transactionUnsafeIO . liftIO $ Rt.evaluateTerm' codeLookup cachedEvalResult evalPPE unisonRuntime tm
332-
case termRef of
332+
result <- fmap eitherToMaybe . PG.transactionUnsafeIO . liftIO $ Rt.evaluateTerm' codeLookup cachedEvalResult evalPPE NoProf unisonRuntime tm
333+
case result of
333334
-- don't cache when there were decompile errors
334-
Just (errs, tmr) | null errs -> do
335+
Just (Rt.DecompErrs errs, _) | not (null errs) -> do
336+
pure ()
337+
Just (_resp, tmr) -> do
335338
Codebase.saveCachedEvalResult
336339
codebase
337340
(Hashing.hashClosedTerm tm)
338341
(Term.amap (const mempty) tmr)
339342
_ -> pure ()
340-
pure $ termRef <&> Term.amap (const mempty) . snd
343+
pure $ result <&> Term.amap (const mempty) . snd
341344

342345
-- | Find all definitions and children reachable from the given 'V2Branch.Branch',
343346
lsBranch ::

0 commit comments

Comments
 (0)