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

result is wrong #216

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

result is wrong #216

wants to merge 4 commits into from

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.

None yet

2 participants