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

Infinite recursion until bug #8430

Open
wooster0 opened this issue Nov 3, 2019 · 1 comment
Open

Infinite recursion until bug #8430

wooster0 opened this issue Nov 3, 2019 · 1 comment

Comments

@wooster0
Copy link
Contributor

wooster0 commented Nov 3, 2019

def method
  until method == 0
  end

  method
end

method
BUG: `!(method)` at eval:2:9 has no type (Exception)
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from ???
  from main
  from __libc_start_main
  from _start
  from ???
Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues

It's a bug related to until. It does not happen with while.

@asterite
Copy link
Member

It does happen with while:

def method
  while !(method == 0)
  end

  method
end

method

(that's what until expands to)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants