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
The following snippet produces a compilation error:
defscope(&)
yieldenddeffoo : Int32?
if x = foo
scope dowhile x
x = foo
endendend0end
foo # BUG: trying to downcast (Int32 | Nil) (Crystal::MixedUnionType) <- Int32 (Crystal::IntegerType) (Exception)
The above pattern can be seen in IO#gets_peek, where foo is IO::Buffered#peek and scope is String.build. This is the root cause behind #8163, #13720, and #13792.
Changing #foo's return type to Int32 or removing it altogether makes the internal error go away. In the case of IO::Buffered#peek this is indeed possible: #13863
The text was updated successfully, but these errors were encountered:
The following snippet produces a compilation error:
The above pattern can be seen in
IO#gets_peek
, wherefoo
isIO::Buffered#peek
andscope
isString.build
. This is the root cause behind #8163, #13720, and #13792.Changing
#foo
's return type toInt32
or removing it altogether makes the internal error go away. In the case ofIO::Buffered#peek
this is indeed possible: #13863The text was updated successfully, but these errors were encountered: