Skip to content

old compiler bug: not a tag union #8111

@Anton-4

Description

@Anton-4
module []

TypeAB x : [A, B]x

TypeCD x : TypeAB [C, D]x

TypeEF x : TypeCD [E, F]x

Combined : TypeCD (TypeAB (TypeEF []))

combined_to_int : Combined -> U8
combined_to_int = |test1|
    when test1 is
        A -> 1
        B -> 2
        C -> 3
        D -> 4
        E -> 5
        F -> 6
        _ -> crash("combined_to_int() failed")

expect
  value = E
  int_value = combined_to_int(E)
  int_value == 5

$ roc test

An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
not a tag union: Alias(`Ast.IdentId(34)`, [3395], <3396>['A' , 'A' , 'B' , 'B' , 'C' , 'D' , 'E' , 'F' , ]<Openness(3)>)
Location: crates/compiler/solve/src/solve.rs:1840:34

Zulip discussion:
#bugs > Compiler crash from pattern matching on nested extended tags @ 💬

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions