I try to write unwrap method but get error
def unwrap(array)
result = [] of typeof(array) | typeof(array.first)
array.each do |item|
if item.is_a?(Array)
result = ([] of typeof(item) | typeof(item.first)) + result
result.concat(item)
else
result << item
end
end
result
end
BUG:
typeof(item)has no type
Simplified version:
foo = 42
if foo.is_a?(String)
[] of typeof(foo) | Int32
end
~I think this might be the same problem as #5717.~
This, #7441, and #7461 all seem to be hitting the same piece of code that raises that exception HERE. So all the issues seem to be related in that something is causing @type and @freeze_type to not exist. However, I don't know enough to take a guess as to why :/
This and #7441 are similar and I already have a fix for them. #7461 is different, I need to reduce it more (that means it should be able to be reproducible if you pass --prelude=empty). I will try to do it later if I have time.
Actually this and #7441 are also different :-P