Skip to content

Commit

Permalink
don't crash when falling back to unary numbers
Browse files Browse the repository at this point in the history
This is useful for doing optimization work, but not useful for
end users.

I'd like to add a toggle for this shortly.
  • Loading branch information
jeremyschlatter committed Dec 19, 2019
1 parent 2e2365c commit 490992c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ readPair :: (MonadMutableRef m, r ~ Ref m) => String -> r (Pair r) -> m (Object
readPair _why x = readRef x >>= \case
MkPair p -> pure p
-- Collapse the optimized representation! :(
Number n -> interpreterBug $ "tried to collapse number " <> show n <> " " <> _why
-- Number n -> collapseNumber n >>= \p -> (writeRef x (MkPair p)) $> p
-- Number n -> interpreterBug $ "tried to collapse number " <> show n <> " " <> _why
Number n -> collapseNumber n >>= \p -> (writeRef x (MkPair p)) $> p
Continuation _ -> pure (Symbol Nil, Symbol Nil)
-- Collapse the optimized representation! :(
OptimizedFunction f -> writeRef x (MkPair (fnFallback f)) $> fnFallback f
Expand Down

0 comments on commit 490992c

Please sign in to comment.