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

Compiler crash with Void function #465

Closed
yhara opened this issue Feb 2, 2023 · 2 comments
Closed

Compiler crash with Void function #465

yhara opened this issue Feb 2, 2023 · 2 comments
Labels

Comments

@yhara
Copy link
Collaborator

yhara commented Feb 2, 2023

Given

class A
  def foo(f: Fn0<Void>) -> String
    f().to_s
  end
end
p A.new.foo{ 123 }
puts "ok"

Expected

Prints Void or something

Actual

PHINode should have one entry for each predecessor of its parent basic block!
  %methodResult = phi %String* [ %result3, %Ret ]
in function A_foo
fatal error: error in backend: Broken function found, compilation aborted!
@yhara yhara added the bug label Feb 2, 2023
@moozzi
Copy link
Contributor

moozzi commented Apr 28, 2023

Is this issue up to date?
It returns this for me:

"123"
ok

@yhara
Copy link
Collaborator Author

yhara commented Apr 28, 2023

Oh I did not notice that compiler does not crash with this.
The result is still wrong but I'll make another issue for that (#479).

@yhara yhara closed this as completed Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants