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
aliasItem= {foo:Int32}
defbar?(item)
trueend
min =0
[{foo:1}, {foo:2}].each do |item|
if bar?(item)
min = [min, item[:foo]]
endend
pp min
This is actually a mistake, because I meant to type min = [min, item[:foo]].min? But it still surprised me when I realized this causes a compiler crash.
The output of crystal build looks like
GC Warning: Repeated allocation of very large block (appr. size 67112960):
May lead to memory leak and poor performance
repeated several times followed by an OverflowError.
This looks pretty similar to #2257, but that issue is old and closed.
The compiler issue here is that the "generic type too nested" error is not raised and the OOM happens during compile time.
Compiling the above program should behave the same as the following one.
min =02.times do
min = [min, 1]
end
$ crystal build foo.cr
Showing last frame. Use --error-trace for full trace.
In foo.cr:126:9
126 | min = [min, 1]
^
Error: generic type too nested: Array(Array(Array(Array(Array( ... stripped ... | Int32) | Int32) | Int32)
Reproducing code:
This is actually a mistake, because I meant to type
min = [min, item[:foo]].min?
But it still surprised me when I realized this causes a compiler crash.The output of
crystal build
looks likerepeated several times followed by an OverflowError.
This looks pretty similar to #2257, but that issue is old and closed.
This is on Arch Linux.
The text was updated successfully, but these errors were encountered: