Skip to content

_aaRange cannot be interpreted at compile time, because it has no available source code #2259

Open
@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

Jeremy Baxter reported this on 2024-07-12T04:54:14Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24658

Description

Associative arrays cannot be iterated over at compile time. This is because the implementation of the range interface for AAs is private.

    enum range = ["a": "b"].byKey();

    void main()
    {
    }

This code fails on DMD 2.108.0 with:

    object.d(3130): Error: `_aaRange` cannot be interpreted at compile time, because it has no available source code

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions