Here's code that causes a compiler exception:
def create_proc(b : String)
if true
begin
->(){""}
rescue
return ->(){}
end
end
end
create_proc "X"
(Also on https://play.crystal-lang.org/#/r/7y27 )
I was able to trigger this issue only in this somewhat narrow set of conditions -- an if, with a begin block, with the begin part not having return, while rescue do having it, and with the proc signature being different.
Appears to be fixed : https://carc.in/#/r/990k
Let's add the example as a spec.
Most helpful comment
Let's add the example as a spec.