crystal
crystal copied to clipboard
Interpreter: Error: BUG: missing upcast_distinct from A+ to B (Crystal::VirtualType to Crystal::NonGenericClassType)
Bug Report
Below code works fine in compiled mode but fails with interpreter.
abstract class A
end
class B < A
end
def validate(b : B)
puts b
end
b = B.new.as(A)
puts b.is_a?(B)
validate(b)
Error from interpreter:
In bin/bugs/virtual.cr:14:10
14 | validate(b)
^
Error: BUG: missing upcast_distinct from A+ to B (Crystal::VirtualType to Crystal::NonGenericClassType)
Crystal version:
Crystal 1.6.0-dev [474129b54] (2022-08-02)
LLVM: 14.0.6
Default target: x86_64-pc-linux-gnu
OS: Ubuntu 22.04
This bug might be related to #12350