You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find a way to reduce the title's size, but basically:
defcapture(&block)
block
end
x =rand<0.5?1 : nilif x
capture do
x +1# undefined method '+' for Nil (compile-time type is (Int32 | Nil))endend
Even though we check that x is not nil, and it's never modified again, the compiler complains because right now any closured variable has all types all the time (they are not affected by type flow). This should be improved by noticing that x doesn't change. It's not trivial because if inside a while or another block it gets tricky, but should be doable.
The text was updated successfully, but these errors were encountered:
I couldn't find a way to reduce the title's size, but basically:
Even though we check that
x
is notnil
, and it's never modified again, the compiler complains because right now any closured variable has all types all the time (they are not affected by type flow). This should be improved by noticing thatx
doesn't change. It's not trivial because if inside awhile
or anotherblock
it gets tricky, but should be doable.The text was updated successfully, but these errors were encountered: