Skip to content

Infinite loop in interpreter #1375

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

Closed
DarkDimius opened this issue Jul 8, 2016 · 0 comments
Closed

Infinite loop in interpreter #1375

DarkDimius opened this issue Jul 8, 2016 · 0 comments

Comments

@DarkDimius
Copy link
Contributor

DarkDimius commented Jul 8, 2016

pasting http://scalapuzzlers.com/#pzzlr-034

val ints = List(1, 2, 3)
val accumulator: List[Int] = Nil

val leftReversed = (ints foldLeft accumulator) { (acc, elem) => elem :: acc }
val rightReversed = (ints foldRight accumulator) { (elem, acc) => acc :+ elem }
println(leftReversed)
println(rightReversed)

// ...and back
println((leftReversed /: accumulator) { (acc, elem) => elem :: acc })
println((rightReversed :\ accumulator) { (elem, acc) => acc :+ elem })

into interpreter sends it into infinite look after the // ...and back comment.
Additionally, we disable control-c, there's no easy way to kill it.

OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this issue Dec 8, 2016
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this issue Dec 12, 2016
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

No branches or pull requests

1 participant