Ary Borenszweig

Results 414 comments of Ary Borenszweig

Further reduced: ```crystal casted_proc : Proc(Int32, Nil) = ->(int : Int32) do p int {10_i64, 20_i64, 30_i64, 40_i64} end casted_proc.call(1) ``` We allow implicit casting from a Proc that doesn't...

Oops: https://stackoverflow.com/a/47089563/4990850 I think we need to fix this to stop compiling. Maybe we can allow this to work for primitives (ints, floats, etc.) and reference types, but nothing else....

Thank you! The bug is super clear now, we just need to decide how and when to fix it. No further detail are needed.

@HertzDevil Yes, but note that this type of casting is done in a lot of places. So for example if you do this: ```crystal proc = ->(x : Int32, y...

@straight-shoota This is the implicit Proc conversion I'm talking about. I think we should eventually fix it by either completely disallowing it, or by introducing a wrapper struct (but it...

We could define the wrapper proc in Crystal itself, maybe put it in `prelude.cr`: ```crystal def __crystal_wrap_proc(proc : Proc(*T, R)) : Proc(*T, Nil) forall T, R {% begin %} ->(...

> Could we perhaps inline this at the callsite? No, because `proc.call` already produces wrong code if the return type is not correct. For the interpreter, `proc.call` will call the...

Interestingly, I can't seem to reproduce the original issue now. [This code snippet](https://github.com/crystal-lang/crystal/issues/10911#issuecomment-877163793) doesn't crash for me.

But, I think we should still move forward with this. Here's an update to what I plan to do: - If there's a conversion between Proc(*R, T) and Proc(*R, Nil)...