-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when upcasting complete Range to Enumerable #10518
Comments
It seems |
Reduced: class Bar(T) # -> Range
end
module Foo(T) # -> Enumerable
end
def foo(x : Bar(Int64))
end
def foo(x : Bar(Int32))
end
class Bar(T)
include Foo(T)
end
Bar(Int32).new.as(Foo(Int32)) # BUG: trying to upcast Foo(Int32) <- Bar(Int32) (Exception) This happens because a bunch of Note that |
A segmentation fault occurs when running the following code.
|
Yes, that appears to be the same issue. |
This was discovered while trying to recreate #4684 (comment). The following code started crashing since 0.36.0:
0x176 is
Range(Int32, Int32).crystal_instance_type_id
.Range(Int64, Int64)
,Range(UInt8, UInt8)
, andRange(UInt64, UInt64)
have a similar issue, when the integer literals and theas
argument are modified. On the other hand,Range(UInt32, UInt32)
andRange(UInt16, UInt16)
produce:Range(Int16, Int16)
produces the following on e572b56:Range(Int8, Int8)
works. Floating-point ranges and ranges with mixed integer types also seem to work.The text was updated successfully, but these errors were encountered: