Skip to content

[REG 1.42] Can supposedly index AA with mismatching key type #5060

@kinke

Description

@kinke

This fails with both beta1 and beta2 of LDC v1.42, but has worked with v1.41 and also works with DMD v2.112.0 and current DMD stable:

enum E { a }
bool[E] aa;
static assert(!__traits(compiles, aa[0])); // would compile since v1.42?!

Of course it wouldn't really compile:

core/internal/newaa.d(172): Error: cannot implicitly convert expression `key` of type `int` to `E`

Weird that this seems to be LDC-specific.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions