a = Slice(UInt8).literal(0)
b = Slice(UInt8).literal(1)
This only happens when both variables are not constants (or if there is no assignment at all) and if both literals have the same amount of elements.
This also doesn't happen if the two literals have different types (ex. Slice(UInt32) and Slice(UInt8)).
Stack trace:
BUG: unhandled primitive in codegen: slice_literal (Exception)
from /crystal/src/compiler/crystal/codegen/codegen.cr:2392:9 in 'visit'
from /crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /crystal/src/compiler/crystal/codegen/codegen.cr:2392:9 in 'codegen_assign'
from /crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /crystal/src/enumerable.cr:510:7 in '??'
from /crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /crystal/src/compiler/crystal/codegen/codegen.cr:2362:7 in 'codegen'
from /crystal/src/compiler/crystal/compiler.cr:202:16 in 'compile:combine_rpath'
from /crystal/src/compiler/crystal/compiler.cr:195:56 in 'compile:combine_rpath'
from /crystal/src/compiler/crystal/command/eval.cr:30:5 in 'eval'
from /crystal/src/compiler/crystal/command.cr:126:12 in 'run'
from /crystal/src/compiler/crystal.cr:11:1 in '__crystal_main'
from /crystal/src/crystal/main.cr:129:5 in 'main'
from src/env/__libc_start_main.c:95:2 in 'libc_start_main_stage2'
Bug Report
The following code results in a compiler bug:
This only happens when both variables are not constants (or if there is no assignment at all) and if both literals have the same amount of elements. This also doesn't happen if the two literals have different types (ex. Slice(UInt32) and Slice(UInt8)).
Stack trace: