Skip to content

[Bug][compiler] compiler crashes when compiling select variants with generics #17081

@rahxephon89

Description

@rahxephon89

🐛 Bug

When compiling the following code:

module 0x42::assign {

    public enum E2<T1, T2, T3> has drop {
        A {x: T1},
        B {y: T3, x: T2}
    }
    fun local_get_x2<T2, T2, T3>(e: &E2<T2, T2, T3>): &T2 {
        &e.x
    }
}

compiler will crash with following error:

thread '<unnamed>' panicked at third_party/move/move-model/src/builder/exp_builder.rs:894:53:
index out of bounds: the len is 2 but the index is 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    For Grabs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions