Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IORunLoop#step bug #533

Merged
merged 1 commit into from
May 20, 2019
Merged

Conversation

nomisRev
Copy link

@nomisRev nomisRev commented May 17, 2019

After a chat on Gitter conversation a PR to fix the following issue.

import cats.effects.IO

IO.pure(1).uncancelable.unsafeRunSync()

// Exception in thread "main" java.lang.AssertionError: unreachable
//  at cats.effect.IO.unsafeRunTimed(IO.scala:328)
//  at cats.effect.IO.unsafeRunSync(IO.scala:240)

This is caused because the callstack is still empty at that point in IORunLoop#step and as an optimization the currentIO doesn't get wrapped in Async.
This causes unsafeRunTimed to run into case _ => throw AssertionError("unreachable")

@codecov-io
Copy link

Codecov Report

Merging #533 into master will decrease coverage by 0.18%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
- Coverage   89.77%   89.59%   -0.19%     
==========================================
  Files          71       71              
  Lines        2054     2056       +2     
  Branches      147      132      -15     
==========================================
- Hits         1844     1842       -2     
- Misses        210      214       +4

@djspiewak djspiewak merged commit eed64fa into typelevel:master May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants