Skip to content

Conversation

@xhudik
Copy link
Contributor

@xhudik xhudik commented Mar 31, 2021

if you run:

var rec = 0
def llRange(lo: Int, hi: Int): LazyList[Int] = {
  rec = rec + 1
  if (lo >= hi) LazyList.empty
  else LazyList.cons(lo, llRange(lo + 1, hi))
}
llRange(1, 10).take(3).toList

rec

you will get result 3 not 4

jisantuc added a commit that referenced this pull request Feb 3, 2022
I've replicated this result in a few Scala 2.13 versions. It's
not clear to me why in #216, the result seems
to be the opposite. This PR is now a bit
of a smoke test for that build failure.
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.

2 participants